[gnome-settings-daemon] xrandr: Swap axes for tablets as well



commit 16c144d41e4d331d9e81fe662d234180eda96983
Author: Heiher <admin heiher info>
Date:   Wed Dec 19 12:16:00 2012 +0000

    xrandr: Swap axes for tablets as well
    
    Note that this should not match Wacom tablets, as they have
    their own way of handling orientation changes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=690488

 plugins/common/gsd-input-helper.c   |    7 +++++++
 plugins/common/gsd-input-helper.h   |    1 +
 plugins/xrandr/gsd-xrandr-manager.c |    3 ++-
 3 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/plugins/common/gsd-input-helper.c b/plugins/common/gsd-input-helper.c
index 06594e9..b81189d 100644
--- a/plugins/common/gsd-input-helper.c
+++ b/plugins/common/gsd-input-helper.c
@@ -191,6 +191,13 @@ device_info_is_touchscreen (XDeviceInfo *device_info)
 }
 
 gboolean
+device_info_is_tablet (XDeviceInfo *device_info)
+{
+        /* Note that this doesn't match Wacom tablets */
+        return (device_info->type == XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), XI_TABLET, False));
+}
+
+gboolean
 device_info_is_mouse (XDeviceInfo *device_info)
 {
         return (device_info->type == XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), XI_MOUSE, False));
diff --git a/plugins/common/gsd-input-helper.h b/plugins/common/gsd-input-helper.h
index f86d2a4..b93b90c 100644
--- a/plugins/common/gsd-input-helper.h
+++ b/plugins/common/gsd-input-helper.h
@@ -61,6 +61,7 @@ gboolean  device_is_touchpad       (XDevice                *xdevice);
 
 gboolean  device_info_is_touchpad    (XDeviceInfo         *device_info);
 gboolean  device_info_is_touchscreen (XDeviceInfo         *device_info);
+gboolean  device_info_is_tablet (XDeviceInfo         *device_info);
 gboolean  device_info_is_mouse       (XDeviceInfo         *device_info);
 gboolean  device_info_is_trackball   (XDeviceInfo         *device_info);
 
diff --git a/plugins/xrandr/gsd-xrandr-manager.c b/plugins/xrandr/gsd-xrandr-manager.c
index 44ae935..96de67d 100644
--- a/plugins/xrandr/gsd-xrandr-manager.c
+++ b/plugins/xrandr/gsd-xrandr-manager.c
@@ -1583,7 +1583,8 @@ rotate_touchscreens (GsdXrandrManager *mgr,
                         continue;
                 }
 
-                if (device_info_is_touchscreen (&device_info[i])) {
+                if (device_info_is_touchscreen (&device_info[i]) ||
+                            device_info_is_tablet (&device_info[i])) {
                         XDevice *device;
                         char c = evdev_rotations[rot_idx].axes_swap;
                         PropertyHelper axes_swap = {



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