gdk: Avoid gdk_device_get_associated_device()

Query the seat for that.
This commit is contained in:
Carlos Garnacho 2020-07-30 14:26:51 +02:00
parent 4dc2ab61c9
commit 94982dbab7
2 changed files with 9 additions and 3 deletions

View File

@ -816,9 +816,15 @@ _gdk_display_get_pointer_info (GdkDisplay *display,
GdkDevice *device)
{
GdkPointerSurfaceInfo *info;
GdkSeat *seat;
if (device && gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
device = gdk_device_get_associated_device (device);
if (device)
{
seat = gdk_device_get_seat (device);
if (device == gdk_seat_get_keyboard (seat))
device = gdk_seat_get_pointer (seat);
}
if (G_UNLIKELY (!device))
return NULL;

View File

@ -1807,7 +1807,7 @@ gdk_surface_set_cursor (GdkSurface *surface,
devices = gdk_seat_get_physical_devices (s->data, GDK_SEAT_CAPABILITY_TABLET_STYLUS);
for (d = devices; d; d = d->next)
{
device = gdk_device_get_associated_device (d->data);
device = d->data;
gdk_surface_set_cursor_internal (surface, device, surface->cursor);
}
g_list_free (devices);