Merge branch 'wip/carlosg/last-device-refcount' into 'gtk-3-24'

gdk: Keep a reference on the last source device

See merge request GNOME/gtk!2510
This commit is contained in:
Matthias Clasen 2020-08-31 14:57:35 +00:00
commit 4efd805110
2 changed files with 2 additions and 1 deletions

View File

@ -278,6 +278,7 @@ free_pointer_info (GdkPointerWindowInfo *info)
{
if (info->toplevel_under_pointer)
g_object_unref (info->toplevel_under_pointer);
g_clear_object (&info->last_slave);
g_slice_free (GdkPointerWindowInfo, info);
}

View File

@ -9931,7 +9931,7 @@ _gdk_windowing_got_event (GdkDisplay *display,
if (source_device != pointer_info->last_slave &&
gdk_device_get_device_type (source_device) == GDK_DEVICE_TYPE_SLAVE)
pointer_info->last_slave = source_device;
g_set_object (&pointer_info->last_slave, source_device);
else if (pointer_info->last_slave)
source_device = pointer_info->last_slave;
}