[gnome-control-center] wacom: Update from gnome-settings-daemon



commit 3968797027a15609de901e57371a6ba3de0548ff
Author: Bastien Nocera <hadess hadess net>
Date:   Fri May 17 09:16:30 2013 +0200

    wacom: Update from gnome-settings-daemon

 panels/wacom/gsd-input-helper.c |   24 ++++++++++++++++--------
 panels/wacom/gsd-input-helper.h |    1 +
 panels/wacom/gsd-wacom-device.c |   37 ++++++++++++++++++++++++++-----------
 panels/wacom/gsd-wacom-device.h |    1 +
 4 files changed, 44 insertions(+), 19 deletions(-)
---
diff --git a/panels/wacom/gsd-input-helper.c b/panels/wacom/gsd-input-helper.c
index b81189d..d5d2a2a 100644
--- a/panels/wacom/gsd-input-helper.c
+++ b/panels/wacom/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;
@@ -129,18 +144,11 @@ supports_xinput2_devices (int *opcode)
         gdk_error_trap_push ();
 
         major = 2;
-        minor = 0;
+        minor = 3;
 
         if (XIQueryVersion (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &major, &minor) != Success) {
                 gdk_error_trap_pop_ignored ();
-                /* try for 2.2, maybe gtk has already announced 2.2 support */
-                gdk_error_trap_push ();
-                major = 2;
-                minor = 2;
-                if (XIQueryVersion (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &major, &minor) != 
Success) {
-                    gdk_error_trap_pop_ignored ();
                     return FALSE;
-                }
         }
         gdk_error_trap_pop_ignored ();
 
diff --git a/panels/wacom/gsd-input-helper.h b/panels/wacom/gsd-input-helper.h
index b93b90c..0bf328a 100644
--- a/panels/wacom/gsd-input-helper.h
+++ b/panels/wacom/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);
diff --git a/panels/wacom/gsd-wacom-device.c b/panels/wacom/gsd-wacom-device.c
index bd58a78..e90371a 100644
--- a/panels/wacom/gsd-wacom-device.c
+++ b/panels/wacom/gsd-wacom-device.c
@@ -258,7 +258,8 @@ gsd_wacom_tablet_button_new (const char               *name,
                             GsdWacomTabletButtonPos   pos,
                             int                       group_id,
                             int                       idx,
-                            int                       status_led)
+                            int                       status_led,
+                            int                       has_oled)
 {
        GsdWacomTabletButton *ret;
 
@@ -277,6 +278,7 @@ gsd_wacom_tablet_button_new (const char               *name,
        ret->type = type;
        ret->pos = pos;
        ret->status_led = status_led;
+       ret->has_oled = has_oled;
 
        return ret;
 }
@@ -1080,7 +1082,8 @@ gsd_wacom_device_add_ring_modes (WacomDevice      *wacom_device,
                                                                           WACOM_TABLET_BUTTON_POS_LEFT,
                                                                           group,
                                                                           0,
-                                                                          GSD_WACOM_NO_LED));
+                                                                          GSD_WACOM_NO_LED,
+                                                                          0));
                } else {
                        for (i = 1; i <= num_modes; i++) {
                                name = g_strdup_printf (_("Left Ring Mode #%d"), i);
@@ -1092,7 +1095,8 @@ gsd_wacom_device_add_ring_modes (WacomDevice      *wacom_device,
                                                                                   
WACOM_TABLET_BUTTON_POS_LEFT,
                                                                                   group,
                                                                                   i - 1,
-                                                                                  GSD_WACOM_NO_LED));
+                                                                                  GSD_WACOM_NO_LED,
+                                                                                  0));
                                g_free (name);
                                g_free (id);
                        }
@@ -1109,7 +1113,8 @@ gsd_wacom_device_add_ring_modes (WacomDevice      *wacom_device,
                                                                           WACOM_TABLET_BUTTON_POS_RIGHT,
                                                                           group,
                                                                           0,
-                                                                          GSD_WACOM_NO_LED));
+                                                                          GSD_WACOM_NO_LED,
+                                                                          0));
                } else {
                        for (i = 1; i <= num_modes; i++) {
                                name = g_strdup_printf (_("Right Ring Mode #%d"), i);
@@ -1121,7 +1126,8 @@ gsd_wacom_device_add_ring_modes (WacomDevice      *wacom_device,
                                                                                   
WACOM_TABLET_BUTTON_POS_RIGHT,
                                                                                   group,
                                                                                   i - 1,
-                                                                                  GSD_WACOM_NO_LED));
+                                                                                  GSD_WACOM_NO_LED,
+                                                                                  0));
                                g_free (name);
                                g_free (id);
                        }
@@ -1160,7 +1166,8 @@ gsd_wacom_device_add_strip_modes (WacomDevice      *wacom_device,
                                                                           WACOM_TABLET_BUTTON_POS_LEFT,
                                                                           group,
                                                                           0,
-                                                                          GSD_WACOM_NO_LED));
+                                                                          GSD_WACOM_NO_LED,
+                                                                          0));
                } else {
                        for (i = 1; i <= num_modes; i++) {
                                name = g_strdup_printf (_("Left Touchstrip Mode #%d"), i);
@@ -1172,7 +1179,8 @@ gsd_wacom_device_add_strip_modes (WacomDevice      *wacom_device,
                                                                                   
WACOM_TABLET_BUTTON_POS_LEFT,
                                                                                   group,
                                                                                   i - 1,
-                                                                                  GSD_WACOM_NO_LED));
+                                                                                  GSD_WACOM_NO_LED,
+                                                                                  0));
                                g_free (name);
                                g_free (id);
                        }
@@ -1189,7 +1197,8 @@ gsd_wacom_device_add_strip_modes (WacomDevice      *wacom_device,
                                                                           WACOM_TABLET_BUTTON_POS_RIGHT,
                                                                           group,
                                                                           0,
-                                                                          GSD_WACOM_NO_LED));
+                                                                          GSD_WACOM_NO_LED,
+                                                                          0));
                } else {
                        for (i = 1; i <= num_modes; i++) {
                                name = g_strdup_printf (_("Right Touchstrip Mode #%d"), i);
@@ -1201,7 +1210,8 @@ gsd_wacom_device_add_strip_modes (WacomDevice      *wacom_device,
                                                                                   
WACOM_TABLET_BUTTON_POS_RIGHT,
                                                                                   group,
                                                                                   i - 1,
-                                                                                  GSD_WACOM_NO_LED));
+                                                                                  GSD_WACOM_NO_LED,
+                                                                                  0));
                                g_free (name);
                                g_free (id);
                        }
@@ -1259,6 +1269,7 @@ gsd_wacom_device_add_buttons_dir (WacomDevice      *wacom_device,
        GList *l;
        guint num_buttons, i, button_num;
        char *name, *id;
+       gboolean has_oled;
 
        l = NULL;
        button_num = 1;
@@ -1275,6 +1286,8 @@ gsd_wacom_device_add_buttons_dir (WacomDevice      *wacom_device,
 
                name = g_strdup_printf (button_str, button_num++);
                id = g_strdup_printf ("%s%c", button_str_id, i);
+               if (libwacom_get_button_flag (wacom_device, i) & WACOM_BUTTON_OLED)
+                       has_oled = TRUE;
                l = g_list_append (l, gsd_wacom_tablet_button_new (name,
                                                                   id,
                                                                   settings_path,
@@ -1282,7 +1295,8 @@ gsd_wacom_device_add_buttons_dir (WacomDevice      *wacom_device,
                                                                   gsd_wacom_device_button_pos (flags),
                                                                   flags_to_group (flags),
                                                                   -1,
-                                                                  GSD_WACOM_NO_LED));
+                                                                  GSD_WACOM_NO_LED,
+                                                                  has_oled));
                g_free (name);
                g_free (id);
        }
@@ -1310,7 +1324,8 @@ gsd_wacom_device_add_buttons_dir (WacomDevice      *wacom_device,
                                                                   gsd_wacom_device_button_pos (flags),
                                                                   flags_to_group (flags),
                                                                   -1,
-                                                                  status_led));
+                                                                  status_led,
+                                                                  FALSE));
                g_free (name);
                g_free (id);
        }
diff --git a/panels/wacom/gsd-wacom-device.h b/panels/wacom/gsd-wacom-device.h
index 335945f..3657e88 100644
--- a/panels/wacom/gsd-wacom-device.h
+++ b/panels/wacom/gsd-wacom-device.h
@@ -123,6 +123,7 @@ typedef struct
        GsdWacomTabletButtonPos   pos;
        int                       group_id, idx;
        int                       status_led;
+       int                       has_oled;
 } GsdWacomTabletButton;
 
 void                  gsd_wacom_tablet_button_free (GsdWacomTabletButton *button);


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