[gnome-settings-daemon] common: Add function to check for XTEST support



commit d12e5e718a3514a2a2dc5c6649c6a90c34f6493e
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Jan 19 01:43:33 2013 +0100

    common: Add function to check for XTEST support

 plugins/common/gsd-input-helper.c |   15 +++++++++++++++
 plugins/common/gsd-input-helper.h |    1 +
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/plugins/common/gsd-input-helper.c b/plugins/common/gsd-input-helper.c
index b81189d..54427af 100644
--- a/plugins/common/gsd-input-helper.c
+++ b/plugins/common/gsd-input-helper.c
@@ -119,6 +119,21 @@ supports_xinput_devices (void)
 }
 
 gboolean
+supports_xtest (void)
+{
+        gint op_code, event, error;
+        gboolean retval;
+
+        retval = XQueryExtension (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
+				  "XTEST",
+				  &op_code,
+				  &event,
+				  &error);
+
+	return retval;
+}
+
+gboolean
 supports_xinput2_devices (int *opcode)
 {
         int major, minor;
diff --git a/plugins/common/gsd-input-helper.h b/plugins/common/gsd-input-helper.h
index b93b90c..0bf328a 100644
--- a/plugins/common/gsd-input-helper.h
+++ b/plugins/common/gsd-input-helper.h
@@ -53,6 +53,7 @@ typedef struct {
 
 gboolean  supports_xinput_devices  (void);
 gboolean  supports_xinput2_devices (int *opcode);
+gboolean  supports_xtest           (void);
 
 gboolean set_device_enabled       (int device_id,
                                    gboolean enabled);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]