Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor scaling issues after aquamarine #7162

Closed
leiserfg opened this issue Aug 3, 2024 · 18 comments · Fixed by #7178
Closed

Cursor scaling issues after aquamarine #7162

leiserfg opened this issue Aug 3, 2024 · 18 comments · Fixed by #7178
Labels
bug Something isn't working

Comments

@leiserfg
Copy link
Contributor

leiserfg commented Aug 3, 2024

Regression?

Yes

System Info and Version

Hyprland in master

Description

After aquamarine cursors rendered by hyprland don't scale with the monitor.

How to reproduce

If you have both HYPRCURSOR_SIZE and XCURSOR_SIZE set to 16 and you scale the monitor to 2 the XCursors looks fine but the hyprcursors looks tiny.
One can workaround it by setting HYPRCURSOR_SIZE to 2 * XCURSOR_SIZE but that will break in other monitors.

Crash reports, logs, images, videos

No response

@leiserfg leiserfg added the bug Something isn't working label Aug 3, 2024
@vaxerski
Copy link
Member

vaxerski commented Aug 3, 2024

bisect please

@leiserfg
Copy link
Contributor Author

leiserfg commented Aug 3, 2024

The issue has been happening since aquamarine was merged, I will try to bisect inside of the aquamarine PR.

@vaxerski
Copy link
Member

vaxerski commented Aug 3, 2024

odd because on my laptop all is good and I use 1.5

@leiserfg
Copy link
Contributor Author

leiserfg commented Aug 3, 2024

I tried with a commit in the middle of the aquamarine pr and got the same, now I'm far from the laptop and partially drunk so I'll keep binary searching when I go back home.

@leiserfg
Copy link
Contributor Author

leiserfg commented Aug 3, 2024

I was trying to bisect but given that during aquamarine development, you were updating all the components in parallel it's very hard to know when the error happened for the first time (as I can't compile some commits cause nix was broken at that point). For what I managed to test:
29598f2 seemed to still be fine, but 648b7b3 was already broken. If you have any clue and you would like to test another of the hundreds of commits let me know 😄

@MahouShoujoMivutilde
Copy link
Contributor

MahouShoujoMivutilde commented Aug 4, 2024

I've found it, 1d4e518 (in move to aquamarine MR) is the first bad commit.

Building 5dd2c27 + aquamarine a70fc6a (latest atm) with

git revert -n 1d4e5187

Completely fixes the scaling problem for me, regardless of values of cursor:enable_hyprcursor, cursor:allow_dumb_copy and cursor:no_hardware_cursors.

Not sure if it's a proper fix though.


All the bisecting is on aquamarine 0ab8ffa, a bit outdated, because I initially misremembered that the cursor was fine until recently, and tried to see if it was aquamarine that broke it.

It wasn't fine. It's just that the issue only manifests for me when hovering over swaybg.

Details

Cursor:

BAD 8a5f9bb keybinds: handle null monitor in pinActive (7122)

BAD r5027.cc7c117f-1 - pre-locks pr?

Further:

BAD 8a5f9bb keybinds: handle null monitor in pinActive (7122)
....
BAD 5979ceb surface: fixup logical damage size calculations

Further:

BAD 016da23 move to aquamarine

Bisecting the aquamarine MR:

BAD 4b84029 rerun pipeline
cedac20 flake: update aquamarine
aa1ebc5 fix possible crash 3
78d11c4 fix possible crash 2
1c5c905 fix crash
8dbaef2 flake: update aquamarine
1d93329 fix
8aff971 fix crashas
70e4670 oopsie daisy
85cf097 flake.lock: update aq
1f84461 [aquamarine] try to fix direct scanout (6875)
0de9568 eee
a3770ab use output state format
a0ec926 logs
ed8b4b7 shm drm woo
557d2ab ci: add aq
f059851 flake.lock: update
65b041d format
c491366 Aquamarine headers for no pch build and a heap use after free (6892)
supposedly BAD 648b7b3 CI/Arch: add libxcursor
b819242 flake.lock: update
b59c159 thanks virt
e444d2a Hw cursors fix for nvidia (6847)
af4a134 thanks ikalco
955ee5f thanks ikalco
BAD fe2fe1f viewporter stuff
8ea0633 add scheduleFrame reasons (6799)
BAD aa6ae13 make explicit sync setting actually disable it
BAD d786094 stuff
CRASH 6289612 reset explicit fences before commit (6841)
0f09940 fix xwayland crash
3886702 better
1fcb8cc swapchain test stuff
CRASH 805a054 Explicit sync fixes (6829)
CRASH 4c905b1 ok gulafaran
cdd037e initialize arrays
8ae38c1 stuff
13af7fb explicit sync stuff
37a96c6 [gha] Nix: update inputs
95ddf9e stuff for aq alloc split
959e83f stuf
FAIL d13189d no leakeroni
1d4e518 e
45f726c dmabufff
be4051e send flag on main tranche
f472dcd ds fixes
76b8be2 some fixes to dmabuf
FAIL 4aa77b2 fixeroni crasheroni
FAIL (supposedly GOOD) 29598f2 flake.lock: update
bd25149 Nix: add xcursor dep
05f7a23 nix: drop unused script after 589f758
d7aded8 cmake: drop unused include after 758c0b3
8cf770b meson: unbreak build with aquamarine
1a1cc59 flake.lock: update aquamarine
ab42822 fix crasheroni
c9fdf62 fixes
e36c1e9 log mismatched fds
1b4a5fc stuf
2fd9013 dont crash on multigpu lol
e09e76a avoid spam
09af47a cursorsss
f4c8789 explicit sync
82e2759 xcursors mmm
c6b9b29 fix mirrors, thanks virtcode
7497181 fix
cff9b4f missed a file
03eb7e3 xcursor stuff
FAIL 590e706 damage oops
9235728 fix nvidia crasherino lmao
360673e fix small ub in keyboard
c03f25e rid of wlr more
...

FAIL means

    [128/248] Building CXX object CMakeFiles/Hyprland.dir/src/managers/KeybindManager.cpp.o
    /build/hyprland-my-aquamarine-git/src/hyprland/src/managers/KeybindManager.cpp: In static member function ‘static uint64_t CKeybindManager::spawnRaw(std::string)’:
    /build/hyprland-my-aquamarine-git/src/hyprland/src/managers/KeybindManager.cpp:905:14: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    905 |         write(socket[1], &grandchild, sizeof(grandchild));
    |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /build/hyprland-my-aquamarine-git/src/hyprland/src/managers/KeybindManager.cpp:912:9: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    912 |     read(socket[0], &grandchild, sizeof(grandchild));
    |     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ninja: build stopped: subcommand failed.
    make: *** [Makefile:15: release] Error 1
    ==> ERROR: A failure occurred in build().
    Aborting...
    ==> ERROR: Build failed, check /var/lib/aurbuild/x86_64/witch/build

Attempting to git cherry-pick -n d786094f on crashes:

BAD d786094 stuff
OLD CRASH 6289612 reset explicit fences before commit (6841)
0f09940 fix xwayland crash
3886702 better
1fcb8cc swapchain test stuff
OLD CRASH 805a054 Explicit sync fixes (6829)
BAD 4c905b1 ok gulafaran
cdd037e initialize arrays
8ae38c1 stuff
BAD 13af7fb explicit sync stuff
37a96c6 [gha] Nix: update inputs
BAD 95ddf9e stuff for aq alloc split
FAIL 959e83f stuf
FAIL d13189d no leakeroni
1d4e518 e
45f726c dmabufff
be4051e send flag on main tranche
f472dcd ds fixes
76b8be2 some fixes to dmabuf
FAIL 4aa77b2 fixeroni crasheroni
FAIL (supposedly GOOD) 29598f2 flake.lock: update
bd25149 Nix: add xcursor dep
05f7a23 nix: drop unused script after 589f758
d7aded8 cmake: drop unused include after 758c0b3
8cf770b meson: unbreak build with aquamarine
1a1cc59 flake.lock: update aquamarine
ab42822 fix crasheroni
c9fdf62 fixes
e36c1e9 log mismatched fds
1b4a5fc stuf
2fd9013 dont crash on multigpu lol
e09e76a avoid spam
09af47a cursorsss
f4c8789 explicit sync
82e2759 xcursors mmm
c6b9b29 fix mirrors, thanks virtcode
7497181 fix
cff9b4f missed a file
03eb7e3 xcursor stuff
FAIL 590e706 damage oops
9235728 fix nvidia crasherino lmao
...

Attempting to git cherry-pick -n 95ddf9e7 d786094f to fix build failing and crashes (probably because of newer aquamarine than it was written for)

BAD 95ddf9e stuff for aq alloc split
OLD FAIL 959e83f stuf
OLD FAIL d13189d no leakeroni
BAD 1d4e518 e
GOOD 45f726c dmabufff
GOOD! but can't click on some buttons be4051e send flag on main tranche
f472dcd ds fixes
76b8be2 some fixes to dmabuf
OLD FAIL 4aa77b2 fixeroni crasheroni
OLD FAIL (supposedly GOOD) 29598f2 flake.lock: update

Result:

1d4e518 is first bad commit.

@vaxerski
Copy link
Member

vaxerski commented Aug 4, 2024

does #7178 fix this>

@leiserfg
Copy link
Contributor Author

leiserfg commented Aug 4, 2024

#7178 does not fix it, but reverting 1d4e518 from master does it.

@vaxerski
Copy link
Member

vaxerski commented Aug 4, 2024

@gulafaran can you integrate this to #7178? seems to make sense

@gulafaran
Copy link
Contributor

@gulafaran can you integrate this to #7178? seems to make sense

will do

@gulafaran
Copy link
Contributor

pushed to #7178 , added a size check inside getShape and reload theme incase scale changed. should get the previous behaviour back.

@MahouShoujoMivutilde
Copy link
Contributor

With default cursor:... it works and the issue with scale is indeed fixed.

However, when no_hardware_cursors = yes there is some seemengly damage problems that even damage_tracking = 0 doesn't fix.

05-08-2024-00_29_14-cropped

allow_dumb_copy = yes also makes the cursor approximately 2 times bigger. But only no_hardware_cursors = yes causes artifacts on cursor.

@gulafaran
Copy link
Contributor

il see if i can reproduce tomorrow its getting late heh

With default cursor:... it works and the issue with scale is indeed fixed.

However, when no_hardware_cursors = yes there is some seemengly damage problems that even damage_tracking = 0 doesn't fix.

05-08-2024-00_29_14-cropped

allow_dumb_copy = yes also makes the cursor approximately 2 times bigger. But only no_hardware_cursors = yes causes artifacts on cursor.

artifacts at all times, and 2 times bigger at all times or do i need two monitors with different scaling to reproduce? thought id ask and il see if i can reproduce it

@MahouShoujoMivutilde
Copy link
Contributor

MahouShoujoMivutilde commented Aug 4, 2024

Artifacts as soon as I set cursor:no_hardware_cursors = yes and reload config, maybe move mouse a bit, scale set 1.25, single monitor, on nvidia. No artifacts with hardware cursors enabled.

Two times bigger immediately after setting allow_dumb_copy = yes and reloading config, no other actions.

Those are two separate effects that can be combined when the said options are both yes.

So yes, at all times as soon as options are set.

@gulafaran
Copy link
Contributor

Artifacts as soon as I set cursor:no_hardware_cursors = yes and reload config, maybe move mouse a bit, scale set 1.25, single monitor, on nvidia. No artifacts with hardware cursors enabled.

Two times bigger immediately after setting allow_dumb_copy = yes and reloading config, no other actions.

Those are two separate effects that can be combined when the said options are both yes.

thanks il see what i can find <3

@gulafaran
Copy link
Contributor

Artifacts as soon as I set cursor:no_hardware_cursors = yes and reload config, maybe move mouse a bit, scale set 1.25, single monitor, on nvidia. No artifacts with hardware cursors enabled.

Two times bigger immediately after setting allow_dumb_copy = yes and reloading config, no other actions.

Those are two separate effects that can be combined when the said options are both yes.

So yes, at all times as soon as options are set.

does it occur on #7178 now? there was a heap use after free going on

@MahouShoujoMivutilde
Copy link
Contributor

No, it's fixed completely in both cases.

cursor.mp4

@gulafaran
Copy link
Contributor

nice :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants