Commit ea6ac663 authored by Lionel Landwerlin's avatar Lionel Landwerlin Committed by Matthias Clasen

x11: make _gdk_device_query_state report the master's device state

Calling XIQueryPointer() on a slave device is going to trigger a
BadDevice X error. So in case we query a slave device state, ask the
master device instead.
parent 201410de
......@@ -329,6 +329,16 @@ gdk_x11_device_xi2_query_state (GdkDevice *device,
display = gdk_window_get_display (window);
default_screen = gdk_display_get_default_screen (display);
if (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_SLAVE)
GdkDevice *master = gdk_device_get_associated_device (device);
if (master)
_gdk_device_query_state (master, window, root_window, child_window,
root_x, root_y, win_x, win_y, mask);
if (!GDK_X11_DISPLAY (display)->trusted_client ||
!XIQueryPointer (GDK_WINDOW_XDISPLAY (window),
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment