mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
gdk/x11: Avoid gdk_device_get_associated_device()
Query the seat for that.
This commit is contained in:
parent
0cbc857ea4
commit
7991032aeb
@ -235,16 +235,6 @@ gdk_x11_device_xi2_query_state (GdkDevice *device,
|
|||||||
scale = GDK_X11_SURFACE (surface)->surface_scale;
|
scale = GDK_X11_SURFACE (surface)->surface_scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_PHYSICAL)
|
|
||||||
{
|
|
||||||
GdkDevice *logical = gdk_device_get_associated_device (device);
|
|
||||||
|
|
||||||
if (logical != NULL)
|
|
||||||
_gdk_device_query_state (logical, surface, child_surface,
|
|
||||||
win_x, win_y, mask);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!GDK_X11_DISPLAY (display)->trusted_client ||
|
if (!GDK_X11_DISPLAY (display)->trusted_client ||
|
||||||
!XIQueryPointer (GDK_DISPLAY_XDISPLAY (display),
|
!XIQueryPointer (GDK_DISPLAY_XDISPLAY (display),
|
||||||
device_xi2->device_id,
|
device_xi2->device_id,
|
||||||
|
@ -914,7 +914,7 @@ handle_hierarchy_changed (GdkX11DeviceManagerXI2 *device_manager,
|
|||||||
else if (ev->info[i].flags & XISlaveAttached ||
|
else if (ev->info[i].flags & XISlaveAttached ||
|
||||||
ev->info[i].flags & XISlaveDetached)
|
ev->info[i].flags & XISlaveDetached)
|
||||||
{
|
{
|
||||||
GdkDevice *logical, *physical;
|
GdkDevice *logical = NULL, *physical;
|
||||||
GdkSeat *seat;
|
GdkSeat *seat;
|
||||||
|
|
||||||
physical = g_hash_table_lookup (device_manager->id_table,
|
physical = g_hash_table_lookup (device_manager->id_table,
|
||||||
@ -923,17 +923,8 @@ handle_hierarchy_changed (GdkX11DeviceManagerXI2 *device_manager,
|
|||||||
if (!physical)
|
if (!physical)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Remove old logical device info */
|
seat = gdk_device_get_seat (physical);
|
||||||
logical = gdk_device_get_associated_device (physical);
|
gdk_seat_default_remove_physical_device (GDK_SEAT_DEFAULT (seat), physical);
|
||||||
|
|
||||||
if (logical != NULL)
|
|
||||||
{
|
|
||||||
_gdk_device_remove_physical_device (logical, physical);
|
|
||||||
_gdk_device_set_associated_device (physical, NULL);
|
|
||||||
|
|
||||||
seat = gdk_device_get_seat (logical);
|
|
||||||
gdk_seat_default_remove_physical_device (GDK_SEAT_DEFAULT (seat), physical);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Add new logical device if it's an attachment event */
|
/* Add new logical device if it's an attachment event */
|
||||||
if (ev->info[i].flags & XISlaveAttached)
|
if (ev->info[i].flags & XISlaveAttached)
|
||||||
|
@ -2208,11 +2208,13 @@ gdk_dnd_handle_key_event (GdkDrag *drag,
|
|||||||
GdkX11Drag *x11_drag = GDK_X11_DRAG (drag);
|
GdkX11Drag *x11_drag = GDK_X11_DRAG (drag);
|
||||||
GdkModifierType state;
|
GdkModifierType state;
|
||||||
GdkDevice *pointer;
|
GdkDevice *pointer;
|
||||||
|
GdkSeat *seat;
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
|
|
||||||
dx = dy = 0;
|
dx = dy = 0;
|
||||||
state = gdk_event_get_modifier_state (event);
|
state = gdk_event_get_modifier_state (event);
|
||||||
pointer = gdk_device_get_associated_device (gdk_event_get_device (event));
|
seat = gdk_event_get_seat (event);
|
||||||
|
pointer = gdk_seat_get_pointer (seat);
|
||||||
|
|
||||||
if (event->event_type == GDK_KEY_PRESS)
|
if (event->event_type == GDK_KEY_PRESS)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user