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. https://bugzilla.gnome.org/show_bug.cgi?id=700233
This commit is contained in:
committed by
Matthias Clasen
parent
201410de60
commit
ea6ac66392
@ -329,6 +329,16 @@ gdk_x11_device_xi2_query_state (GdkDevice *device,
|
|||||||
display = gdk_window_get_display (window);
|
display = gdk_window_get_display (window);
|
||||||
default_screen = gdk_display_get_default_screen (display);
|
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);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!GDK_X11_DISPLAY (display)->trusted_client ||
|
if (!GDK_X11_DISPLAY (display)->trusted_client ||
|
||||||
!XIQueryPointer (GDK_WINDOW_XDISPLAY (window),
|
!XIQueryPointer (GDK_WINDOW_XDISPLAY (window),
|
||||||
device_xi2->device_id,
|
device_xi2->device_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user