wayland: Ensure that _get_client_pointer returns a pointer

The previous implementation could return a device that is a keyboard.
This commit is contained in:
Rob Bradford 2012-07-11 16:12:50 +01:00
parent 77791f0708
commit 17d1c3c833

View File

@ -1320,9 +1320,20 @@ static GdkDevice *
gdk_device_manager_core_get_client_pointer (GdkDeviceManager *device_manager)
{
GdkDeviceManagerCore *device_manager_core;
GList *l;
device_manager_core = (GdkDeviceManagerCore *) device_manager;
return device_manager_core->devices->data;
/* Find the first pointer device */
for (l = device_manager_core->devices; l != NULL; l = l->next)
{
GdkDevice *device = l->data;
if (gdk_device_get_source (device) == GDK_SOURCE_MOUSE)
return device;
}
return NULL;
}
static void