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



commit 0dca4e7fe967fef087021cd05599d2239b6dd579
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 3fbe126..9f9721b 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>
 
@@ -58,6 +59,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;
@@ -65,6 +68,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;
        default:
                g_warning ("Unhandled input source %d\n", source);
        }


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