summaryrefslogtreecommitdiff
path: root/clutter
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2017-06-30 12:15:54 +0200
committerCarlos Garnacho <carlosg@gnome.org>2017-07-12 23:43:23 +0200
commit328e3f8f4fd4a384f500e1ea0e4e6b165a899e21 (patch)
treea33bdd796b7ff15bf8f47d145a9144a22014570d /clutter
parent7bd69f0b32ca899f17a6081685eb32925b25a0f1 (diff)
downloadmutter-328e3f8f4fd4a384f500e1ea0e4e6b165a899e21.tar.gz
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
Diffstat (limited to 'clutter')
-rw-r--r--clutter/clutter/clutter-input-device.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/clutter/clutter/clutter-input-device.c b/clutter/clutter/clutter-input-device.c
index d8caf0118..f084d3a7a 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;