fix: Handle window drag by touch input#444
Merged
3v1n0 merged 1 commit intoubuntu:mainfrom Apr 9, 2026
Merged
Conversation
a1464fd to
52799bb
Compare
Contributor
|
Contributor
Author
|
Yes but there's not enough information in the |
Collaborator
|
I don't know enough about GNOME Shell's/mutter's internals to really review this (nor do I have a touch device to test this). But since this doesn't seem to interfere with the existing behavior, I'll merge it. Could you just please "disconnect" the |
3v1n0
reviewed
Apr 6, 2026
global.get_pointer() does not track touch input, so when initiating a drag via touchscreen we would be incorrectly tracking the mouse position instead. Unfortunately, in GNOME 50 there is no API to get information on the touch point that is driving the window drag from Display::grab-op-begin. The best we can do is track global events happening before grab-op-begin and try to infer which touch point is driving the drag. Specifically, the global stage receives a LEAVE event from the device starting the window drag immediatly prior to Display::grab-op-begin. For this implementation we use the Clutter.Sprite API which is new in GNOME 49, and specifically Cluter.Sprite::get_coords() which is new in GNOME 50, but we fall-back to global.get_pointer() to support older shell versions, where however the bug will not be fixed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
global.get_pointer() does not track touch input, so when initiating a drag via touchscreen we would be incorrectly tracking the mouse position instead.
Unfortunately, in GNOME 50 there is no API to get information on the touch point that is driving the window drag from Display::grab-op-begin. The best we can do is track global events happening before grab-op-begin and try to infer which touch point is driving the drag. Specifically, the global stage receives a LEAVE event from the device starting the window drag immediatly prior to Display::grab-op-begin.
For this implementation we use the Clutter.Sprite API which is new in GNOME 49, and specifically Cluter.Sprite::get_coords() which is new in GNOME 50, but we fall-back to global.get_pointer() to support older shell versions, where however the bug will not be fixed.