Skip to content

[Input] Improve pointer clamping#1907

Merged
Drakulix merged 2 commits intopop-os:masterfrom
git-f0x:master
Dec 22, 2025
Merged

[Input] Improve pointer clamping#1907
Drakulix merged 2 commits intopop-os:masterfrom
git-f0x:master

Conversation

@git-f0x
Copy link
Contributor

@git-f0x git-f0x commented Dec 19, 2025

This seems to match the behavior on other compositors and fixes #981.

I noticed that the cursor completely disappears when it's placed all the way to the right, rather than a small 1px portion still being visible like it is on other compositors or e.g. Windows, so it seemed like an off-by-one issue.

Moves pointer clamping to before new_under, since it previously ignored any motion that goes off screen, causing issues in some fullscreen clients. Fixes #1286.

The second (edit: now first) commit is optional, but some other components are already on 1.90, and it allows using f64::next_down().

Not sure if similar parts of the zoom code should also have the same change, since I'm not fully sure if it's affected by this.
Edit: I think not, since it seems to make the issue Levi mentioned easier to reproduce.

@leviport leviport self-assigned this Dec 19, 2025
@leviport leviport requested review from a team December 19, 2025 18:21
@leviport
Copy link
Member

I'm pretty sure this also fixes pop-os/cosmic-epoch#2683. So far I haven't been able to recreate it after this update.

leviport
leviport previously approved these changes Dec 19, 2025
Copy link
Member

@leviport leviport left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems good to me. Tested on multi-monitor and single monitor configurations. I'm not sure that pop-os/cosmic-epoch#2683 is entirely solved, but this certainly makes it much harder to recreate.

@git-f0x git-f0x force-pushed the master branch 2 times, most recently from c8bd6e1 to 593ba89 Compare December 22, 2025 11:29
@git-f0x git-f0x changed the title [Input] Clamp cursor position to 1 below output size [Input] Improve pointer clamping Dec 22, 2025
- Reduces the max clamp value by 1, since it previously ended up 1 pixel off screen. Fixes pop-os#981.
- Moves clamping to before  `new_under`, since it previously ignored any motion that goes off screen, causing issues in some fullscreen clients. Fixes pop-os#1286.
@git-f0x
Copy link
Contributor Author

git-f0x commented Dec 22, 2025

This now has an extra change that might fix some gaming issues. I haven't noticed issues from some testing (and it really improves behavior in affected games), but not sure if it might regress something.

@Drakulix Drakulix requested a review from leviport December 22, 2025 11:51
@Drakulix
Copy link
Member

@leviport Can you give a quick re-approve after the rebase?

@git-f0x Thanks!

@Drakulix Drakulix merged commit 9e143da into pop-os:master Dec 22, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants