gdk/x11: Avoid gdk_device_get_associated_device()

Query the seat for that.
This commit is contained in:
Carlos Garnacho 2020-07-30 14:28:15 +02:00
parent 0cbc857ea4
commit 7991032aeb
3 changed files with 6 additions and 23 deletions

View File

@ -235,16 +235,6 @@ gdk_x11_device_xi2_query_state (GdkDevice *device,
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 ||
!XIQueryPointer (GDK_DISPLAY_XDISPLAY (display),
device_xi2->device_id,

View File

@ -914,7 +914,7 @@ handle_hierarchy_changed (GdkX11DeviceManagerXI2 *device_manager,
else if (ev->info[i].flags & XISlaveAttached ||
ev->info[i].flags & XISlaveDetached)
{
GdkDevice *logical, *physical;
GdkDevice *logical = NULL, *physical;
GdkSeat *seat;
physical = g_hash_table_lookup (device_manager->id_table,
@ -923,17 +923,8 @@ handle_hierarchy_changed (GdkX11DeviceManagerXI2 *device_manager,
if (!physical)
continue;
/* Remove old logical device info */
logical = gdk_device_get_associated_device (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);
}
seat = gdk_device_get_seat (physical);
gdk_seat_default_remove_physical_device (GDK_SEAT_DEFAULT (seat), physical);
/* Add new logical device if it's an attachment event */
if (ev->info[i].flags & XISlaveAttached)

View File

@ -2208,11 +2208,13 @@ gdk_dnd_handle_key_event (GdkDrag *drag,
GdkX11Drag *x11_drag = GDK_X11_DRAG (drag);
GdkModifierType state;
GdkDevice *pointer;
GdkSeat *seat;
int dx, dy;
dx = dy = 0;
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)
{