[gtk+/events-refactor: 823/1085] GdkDisplayX11: Make core pointer detection a bit more robust.
- From: Carlos Garnacho <carlosg src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+/events-refactor: 823/1085] GdkDisplayX11: Make core pointer detection a bit more robust.
- Date: Tue, 29 Sep 2009 10:48:52 +0000 (UTC)
commit 5515288fed76c2c7b04588cbfb14b20e7b9114c1
Author: Carlos Garnacho <carlos lanedo com>
Date: Tue Aug 25 22:46:56 2009 +0200
GdkDisplayX11: Make core pointer detection a bit more robust.
Now it tries to detect the first device whose source is a mouse. Bear in
mind that this is still quite weak and is just provided for backwards
compatibility.
gdk/x11/gdkdisplay-x11.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index dc17a5b..ac0a61e 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1110,8 +1110,20 @@ _gdk_input_init (GdkDisplay *display)
list = gdk_device_manager_get_devices (device_manager, GDK_DEVICE_TYPE_FLOATING);
display_x11->input_devices = g_list_concat (display_x11->input_devices, list);
- /* Now set "core" pointer to the first master device */
- display->core_pointer = display_x11->input_devices->data;
+ /* Now set "core" pointer to the first master device that is a pointer */
+ list = display_x11->input_devices;
+
+ while (list)
+ {
+ GdkDevice *device = list->data;
+ list = list->next;
+
+ if (device->source != GDK_SOURCE_MOUSE)
+ continue;
+
+ display->core_pointer = device;
+ break;
+ }
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]