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

Fix up pointer constraint interaction with tablet input #5300

Merged
merged 1 commit into from
May 13, 2020

Conversation

Xyene
Copy link
Member

@Xyene Xyene commented May 2, 2020

Fixes #5268.

The less-obvious part of this change is in the second commit, with the (unexpected) problem described in its message. By my understanding of the pointer constraint spec this should be correct, but I wouldn't bet on my understanding :)

@Xyene Xyene force-pushed the tablet-tool-pointer-constraint branch from 043e5ac to d564174 Compare May 2, 2020 23:47
@Xyene Xyene marked this pull request as draft May 3, 2020 00:34
@Xyene Xyene force-pushed the tablet-tool-pointer-constraint branch 2 times, most recently from cc9c47b to 5f1a724 Compare May 4, 2020 16:18
@Xyene Xyene marked this pull request as ready for review May 4, 2020 16:18
sway/input/cursor.c Outdated Show resolved Hide resolved
@emersion
Copy link
Member

This commit addresses this behavior by only warping on the first surface commit since the pointer constraint was added.

Hmm, I don't think this is correct. If the pointer is confined and the surface changes the confine region, we should probably wrap.

@Xyene
Copy link
Member Author

Xyene commented May 12, 2020

I think you're right, I missed that there's a set_region request and assumed a new region would create a new confine, but that's not the case.

Part of the issue here is that wlroots handles confine regions transparently, and doesn't explicitly notify sway when they change. Instead, since it has no information to the contrary, sway performs warping logic on every surface commit regardless of if the region has changed.

I think a solution here would be to make wlroots signal sway when the region changes, so sway doesn't have to warp every commit. I'll take a look at doing that in a separate patch, and base this one off that if it ends up working.

@Xyene Xyene force-pushed the tablet-tool-pointer-constraint branch from 5f1a724 to 2d49576 Compare May 12, 2020 20:48
@Xyene Xyene force-pushed the tablet-tool-pointer-constraint branch from 2d49576 to 04fef58 Compare May 12, 2020 20:49
@Xyene
Copy link
Member Author

Xyene commented May 12, 2020

Alright, I've split off the pointer region warping into swaywm/wlroots#2191 and #5334; this PR contains just the remaining logic to allow tablet input to leave the confine. With the other two commits applied, the issue remains resolved.

Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

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

This approach looks good. Thanks!

@emersion emersion merged commit 2262ae6 into swaywm:master May 13, 2020
@Xyene Xyene deleted the tablet-tool-pointer-constraint branch October 18, 2020 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Pointer constraints are applied inconsistently to tablet pen input
2 participants