GNOME Bugzilla – Bug 762662
gdk_device_warp doesn't support sub-gdk-pixel warpping
Last modified: 2018-04-15 00:01:23 UTC
gdk_device_warp accepts two gints for its target position, which means it is impossible to warp the pointer to a sub-gdk-pixel position on HiDPI mode, which could be problematic in some cases.
Unless you have a concrete case, I don't think it is worth keeping a bug open for a hypothetical "some cases". What we should do in any case is clarify what coordinate space those arguments are in.
When I tried to fix Firefox's bug 1244546 [1] that the Pointer Lock API doesn't work properly on our GTK+ port with HiDPI environment, I found some difficulity writing the patch due to this issue. In Firefox, the Pointer Lock API works by constantly moving the pointer back to the center of the window. For not exposing the extra mouse move events triggered by the pointer warpping, we explicitly detect and filter out an event when it is right after another event, and it is at the center of the window. Since the center of the window we calculate can be at a sub-gdk-pixel position, not being able to move to the exact center causes us fail to filter out the events, and consequently the warpping constantly triggers mouse move. This can be worked around via rounding the position we use for warpping in advance. This is not required in any other platforms, though. To clarify, we do not need to wait for this getting fixed, so it's not critical for us. But I think providing this could make future developers happier when working on HiDPI support with GTK+. [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1244546
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
I'd like to keep this open, but I cannot change the status of this bug to anything other than RESOLVED...
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla. If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab: https://gitlab.gnome.org/GNOME/gtk/issues/new