[gtk+/multitouch-for-3.4: 1/89] gdk: Add GDK_SOURCE_TOUCH
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/multitouch-for-3.4: 1/89] gdk: Add GDK_SOURCE_TOUCH
- Date: Thu, 23 Feb 2012 12:26:01 +0000 (UTC)
commit 010e6821609d3d6048fdd3cdef2e2fdc862b650d
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Nov 23 19:36:51 2011 +0100
gdk: Add GDK_SOURCE_TOUCH
This device source applies to touch capable devices, most
notably touchscreens.
gdk/gdkdevice.h | 4 +++-
gdk/x11/gdkdevicemanager-xi2.c | 4 ++++
2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gdk/gdkdevice.h b/gdk/gdkdevice.h
index 9109d65..3cd97d1 100644
--- a/gdk/gdkdevice.h
+++ b/gdk/gdkdevice.h
@@ -61,6 +61,7 @@ typedef enum
* of a stylus on a graphics tablet.
* @GDK_SOURCE_CURSOR: the device is a graphics tablet "puck" or similar device.
* @GDK_SOURCE_KEYBOARD: the device is a keyboard.
+ * @GDK_SOURCE_TOUCH: the device is a touch capable device.
*
* An enumeration describing the type of an input device in general terms.
*/
@@ -70,7 +71,8 @@ typedef enum
GDK_SOURCE_PEN,
GDK_SOURCE_ERASER,
GDK_SOURCE_CURSOR,
- GDK_SOURCE_KEYBOARD
+ GDK_SOURCE_KEYBOARD,
+ GDK_SOURCE_TOUCH
} GdkInputSource;
/**
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index 273ca7d..01f69cc 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -254,6 +254,10 @@ create_device (GdkDeviceManager *device_manager,
input_source = GDK_SOURCE_ERASER;
else if (strstr (tmp_name, "cursor"))
input_source = GDK_SOURCE_CURSOR;
+ else if (strstr (tmp_name, "finger") ||
+ (strstr (tmp_name, "touch") &&
+ !strstr (tmp_name, "touchpad")))
+ input_source = GDK_SOURCE_TOUCH;
else if (strstr (tmp_name, "wacom") ||
strstr (tmp_name, "pen"))
input_source = GDK_SOURCE_PEN;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]