Skip to content

fix(input): Fix pointer sticking to screen edges during cursor movement#2117

Draft
rhessus wants to merge 1 commit intopop-os:masterfrom
rhessus:fix-issue-2102
Draft

fix(input): Fix pointer sticking to screen edges during cursor movement#2117
rhessus wants to merge 1 commit intopop-os:masterfrom
rhessus:fix-issue-2102

Conversation

@rhessus
Copy link

@rhessus rhessus commented Feb 18, 2026

This PR fixes the pointer behavior reported in the linked issue where the cursor becomes stuck on screen edges during normal movement when multiple displays are connected.

The problem can be observed when moving the mouse left ↔ right as well as up ↕ down. Under certain display arrangements, the pointer incorrectly clamps to output boundaries instead of transitioning smoothly, resulting in the cursor appearing to "stick" to the edges.

  • I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

Fixes #2102

@rhessus rhessus changed the title fix: Cursor getting stuck at display edge when moving from left to right or top to bottom fix(input): Fix pointer sticking to screen edges during cursor movement Feb 18, 2026
@rhessus rhessus marked this pull request as draft February 18, 2026 22:03
@rhessus rhessus force-pushed the fix-issue-2102 branch 7 times, most recently from 5a5177b to 6f43079 Compare February 22, 2026 20:36
@rhessus
Copy link
Author

rhessus commented Feb 22, 2026

Mouse position clamping at output edges

  • When the pointer goes past the right edge of an output, it is clamped to the rightmost column of that output (right edge − 1.0) only if there is no other output to the right of it. If there is an output on the right, the pointer is allowed to move into it.
  • When the pointer goes past the bottom edge of an output, it is clamped to the bottommost row (bottom edge − 1.0) only if there is no other output below. If there is an output below, the pointer is allowed to move into it.

So clamping to the right/bottom edge (−1.0) is applied only when that edge is the actual boundary of the output layout (no adjacent output on that side), avoiding the pointer getting stuck at the edge when multiple outputs are arranged side by side or stacked.


@rhessus rhessus marked this pull request as ready for review February 22, 2026 20:41
@rhessus rhessus force-pushed the fix-issue-2102 branch 4 times, most recently from 2ce231c to 9512055 Compare February 22, 2026 22:39
@rhessus rhessus marked this pull request as draft February 22, 2026 23:05
@Drakulix
Copy link
Member

Can you post an example of an outputs.ron file that re-produces this bug? Outputs should be placed without any gaps between them, so I am failing to see how this would occur without explicitly messing with the configuration file.

@rhessus
Copy link
Author

rhessus commented Feb 23, 2026

Can you post an example of an outputs.ron file that re-produces this bug? Outputs should be placed without any gaps between them, so I am failing to see how this would occur without explicitly messing with the configuration file.

This PR is related to the change introduced in PR 1907 (#1907), which modified the mouse clamping on the right and bottom edges of the screen to use max - 1.0.

image

I am finishing resolving the issue and will provide full reproduction details. But to reproduce the issue, simply use two displays placed side by side and move the mouse very slowly from the left display to the right display (or from the top display to the bottom display). You will notice that the mouse cursor sticks to the boundary between the two displays. This does not occur if the mouse is moved very quickly (delta.x|y > 1.0).

Correcting this issue is somewhat more complex than the changes I have made so far. I will return with an appropriate solution as soon as possible.

@rhessus rhessus force-pushed the fix-issue-2102 branch 5 times, most recently from c0761ca to 20c5343 Compare March 1, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cursor getting stuck at display edge when moving from left to right

2 participants