After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 692411 - Slave device tracking goes wrong when there are no GDK_DEVICE_TYPE_SLAVE
Slave device tracking goes wrong when there are no GDK_DEVICE_TYPE_SLAVE
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: GdkDevice
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Carlos Garnacho
Depends on:
Blocks:
 
 
Reported: 2013-01-23 19:03 UTC by Rob Bradford
Modified: 2013-02-13 16:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix issue (1.17 KB, patch)
2013-01-23 19:03 UTC, Rob Bradford
accepted-commit_now Details | Review
gdkwindow: don't use last_slave for the source device if it is NULL (1.64 KB, patch)
2013-02-07 12:05 UTC, Thomas Wood
committed Details | Review

Description Rob Bradford 2013-01-23 19:03:43 UTC
Created attachment 234234 [details] [review]
Patch to fix issue

in _gdk_windowing_got_event the source device that is passed into _gdk_display_device_grab_update is based on the value from the last saved slave device.

On the Wayland backend (and from a grep, it looks like on many other backends) we have no slave devices (currently...maybe we should?) Because we have no slave devices we never update the "last_slave".

The attached patch checks if have got a saved device before trying to use that.
Comment 1 Carlos Garnacho 2013-02-06 12:02:42 UTC
Comment on attachment 234234 [details] [review]
Patch to fix issue

The patch is obviously fine, and indeed adds safety, although I would recommend for the wayland backend to set source_device==device on events, IIRC win32 and quartz do it this way
Comment 2 Rob Bradford 2013-02-06 14:18:37 UTC
Thanks Carlos, committed and pushed.
Comment 3 Thomas Wood 2013-02-07 12:05:22 UTC
Created attachment 235380 [details] [review]
gdkwindow: don't use last_slave for the source device if it is NULL

This issue also occurs when synthesized crossing events are created.
Comment 4 Thomas Wood 2013-02-07 12:08:29 UTC
last_slave is also used in the proxy_pointer_event function, so may need do be checked there too.
Comment 5 Matthias Clasen 2013-02-11 03:05:33 UTC
Review of attachment 235380 [details] [review]:

ok
Comment 6 Thomas Wood 2013-02-12 15:46:36 UTC
Comment on attachment 235380 [details] [review]
gdkwindow: don't use last_slave for the source device if it is NULL

Attachment 235380 [details] pushed as 8568d66 - gdkwindow: don't use last_slave for the source device if it is NULL
Comment 7 Matthias Clasen 2013-02-13 00:12:32 UTC
all fixed here, I assume ?
Comment 8 Rob Bradford 2013-02-13 16:28:10 UTC
Thomas, did you still think your "comment 4" still stands?