[gnome-control-center/gnome-3-22] common: Handle pad devices in GsdDeviceManagerX11



commit 30e262fd220eb85bcaa7bb00bd251df1b7598489
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Nov 1 12:44:21 2016 +0100

    common: Handle pad devices in GsdDeviceManagerX11
    
    We cater for the old(=Wacom) and new(=libinput) type/name schemes,
    so we don't require a too recent gtk+ just for this.

 panels/common/gsd-device-manager-x11.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/panels/common/gsd-device-manager-x11.c b/panels/common/gsd-device-manager-x11.c
index fa7047e..1e3571f 100644
--- a/panels/common/gsd-device-manager-x11.c
+++ b/panels/common/gsd-device-manager-x11.c
@@ -21,6 +21,7 @@
 
 #include "config.h"
 
+#include <string.h>
 #include <gdk/gdk.h>
 #include <gdk/gdkx.h>
 
@@ -56,6 +57,8 @@ device_get_device_type (GdkDevice *gdk_device)
        case GDK_SOURCE_PEN:
        case GDK_SOURCE_ERASER:
        case GDK_SOURCE_CURSOR:
+               if (strstr (gdk_device_get_name (gdk_device), "pad"))
+                       return GSD_DEVICE_TYPE_TABLET | GSD_DEVICE_TYPE_PAD;
                return GSD_DEVICE_TYPE_TABLET;
        case GDK_SOURCE_KEYBOARD:
                return GSD_DEVICE_TYPE_KEYBOARD;
@@ -63,6 +66,8 @@ device_get_device_type (GdkDevice *gdk_device)
                return GSD_DEVICE_TYPE_TOUCHSCREEN;
        case GDK_SOURCE_TOUCHPAD:
                return GSD_DEVICE_TYPE_TOUCHPAD;
+       case GDK_SOURCE_TABLET_PAD:
+               return GSD_DEVICE_TYPE_PAD;
        }
 
        g_warning ("Unhandled input source %d\n", source);


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