[mutter] clutter: Extend mapping-mode to pen/eraser devices



commit 328e3f8f4fd4a384f500e1ea0e4e6b165a899e21
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jun 30 12:15:54 2017 +0200

    clutter: Extend mapping-mode to pen/eraser devices
    
    This just used to apply to CLUTTER_TABLET_DEVICE on wayland, allow using
    it on pen/eraser devices (as X11 sees tablets) for consistency.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784402

 clutter/clutter/clutter-input-device.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/clutter/clutter/clutter-input-device.c b/clutter/clutter/clutter-input-device.c
index d8caf01..f084d3a 100644
--- a/clutter/clutter/clutter-input-device.c
+++ b/clutter/clutter/clutter-input-device.c
@@ -2243,10 +2243,15 @@ clutter_input_device_get_device_node (ClutterInputDevice *device)
 ClutterInputDeviceMapping
 clutter_input_device_get_mapping_mode (ClutterInputDevice *device)
 {
+  ClutterInputDeviceType device_type;
+
   g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device),
                         CLUTTER_INPUT_DEVICE_MAPPING_ABSOLUTE);
-  g_return_val_if_fail (clutter_input_device_get_device_type (device) ==
-                        CLUTTER_TABLET_DEVICE,
+
+  device_type = clutter_input_device_get_device_type (device);
+  g_return_val_if_fail (device_type == CLUTTER_TABLET_DEVICE ||
+                        device_type == CLUTTER_PEN_DEVICE ||
+                        device_type == CLUTTER_ERASER_DEVICE,
                         CLUTTER_INPUT_DEVICE_MAPPING_ABSOLUTE);
 
   return device->mapping_mode;
@@ -2256,9 +2261,14 @@ void
 clutter_input_device_set_mapping_mode (ClutterInputDevice        *device,
                                        ClutterInputDeviceMapping  mapping)
 {
+  ClutterInputDeviceType device_type;
+
   g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device));
-  g_return_if_fail (clutter_input_device_get_device_type (device) ==
-                    CLUTTER_TABLET_DEVICE);
+
+  device_type = clutter_input_device_get_device_type (device);
+  g_return_if_fail (device_type == CLUTTER_TABLET_DEVICE ||
+                    device_type == CLUTTER_PEN_DEVICE ||
+                    device_type == CLUTTER_ERASER_DEVICE);
 
   if (device->mapping_mode == mapping)
     return;


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