[gtk+/xi2] GdkDeviceManagerXI: Mark keyboard devices as such.
- From: Carlos Garnacho <carlosg src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+/xi2] GdkDeviceManagerXI: Mark keyboard devices as such.
- Date: Sun, 4 Oct 2009 10:33:44 +0000 (UTC)
commit 8c885f0752c25dadb1565d7b0970029f0ba62853
Author: Carlos Garnacho <carlos gnome org>
Date: Sun Oct 4 12:04:20 2009 +0200
GdkDeviceManagerXI: Mark keyboard devices as such.
gdk/x11/gdkdevicemanager-xi.c | 38 +++++++++++++++++++++-----------------
1 files changed, 21 insertions(+), 17 deletions(-)
---
diff --git a/gdk/x11/gdkdevicemanager-xi.c b/gdk/x11/gdkdevicemanager-xi.c
index 5911ebd..79446cd 100644
--- a/gdk/x11/gdkdevicemanager-xi.c
+++ b/gdk/x11/gdkdevicemanager-xi.c
@@ -221,27 +221,33 @@ create_device (GdkDeviceManager *device_manager,
{
GdkInputSource input_source;
GdkDevice *device;
- gchar *tmp_name;
if (info->use != IsXExtensionPointer &&
info->use != IsXExtensionKeyboard)
return NULL;
- tmp_name = g_ascii_strdown (info->name, -1);
-
- if (g_str_has_suffix (tmp_name, "pointer"))
- input_source = GDK_SOURCE_MOUSE;
- else if (strcmp (tmp_name, "wacom") == 0 ||
- strcmp (tmp_name, "pen") == 0)
- input_source = GDK_SOURCE_PEN;
- else if (strcmp (tmp_name, "eraser") == 0)
- input_source = GDK_SOURCE_ERASER;
- else if (strcmp (tmp_name, "cursor") == 0)
- input_source = GDK_SOURCE_CURSOR;
+ if (info->use == IsXExtensionKeyboard)
+ input_source = GDK_SOURCE_KEYBOARD;
else
- input_source = GDK_SOURCE_PEN;
+ {
+ gchar *tmp_name;
+
+ tmp_name = g_ascii_strdown (info->name, -1);
+
+ if (g_str_has_suffix (tmp_name, "pointer"))
+ input_source = GDK_SOURCE_MOUSE;
+ else if (strcmp (tmp_name, "wacom") == 0 ||
+ strcmp (tmp_name, "pen") == 0)
+ input_source = GDK_SOURCE_PEN;
+ else if (strcmp (tmp_name, "eraser") == 0)
+ input_source = GDK_SOURCE_ERASER;
+ else if (strcmp (tmp_name, "cursor") == 0)
+ input_source = GDK_SOURCE_CURSOR;
+ else
+ input_source = GDK_SOURCE_PEN;
- g_free (tmp_name);
+ g_free (tmp_name);
+ }
device = g_object_new (GDK_TYPE_DEVICE_XI,
"name", info->name,
@@ -442,8 +448,6 @@ gdk_device_manager_xi_translate_event (GdkEventTranslator *translator,
&event->button.x,
&event->button.y);
-
-
event->button.state = translate_state (xdbe->state, xdbe->device_state);
event->button.button = xdbe->button;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]