summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2016-06-22 16:04:11 +0200
committerCarlos Garnacho <carlosg@gnome.org>2016-07-22 13:31:09 +0200
commit08cda496f8c1e64b84554d8e327aedf5356ca015 (patch)
tree0c78acb91698608b13cb40c0ffd5a267065c88fe
parentf9552bb9c0e32d252f3341ff513bccc7bbc6f118 (diff)
downloadmutter-08cda496f8c1e64b84554d8e327aedf5356ca015.tar.gz
wayland: Apply pressure settings before sending wp_tablet_tool.pressure
-rw-r--r--src/wayland/meta-wayland-tablet-tool.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/wayland/meta-wayland-tablet-tool.c b/src/wayland/meta-wayland-tablet-tool.c
index 6ba9f87ac..88efdb058 100644
--- a/src/wayland/meta-wayland-tablet-tool.c
+++ b/src/wayland/meta-wayland-tablet-tool.c
@@ -744,6 +744,24 @@ broadcast_axis (MetaWaylandTabletTool *tool,
if (!clutter_input_device_get_axis_value (source, event->motion.axes, axis, &val))
return;
+ if (axis == CLUTTER_INPUT_AXIS_PRESSURE)
+ {
+ MetaInputSettings *input_settings;
+ ClutterInputDevice *device;
+ MetaBackend *backend;
+
+ backend = meta_get_backend ();
+ input_settings = meta_backend_get_input_settings (backend);
+ device = clutter_event_get_source_device (event);
+
+ if (input_settings)
+ {
+ val = meta_input_settings_translate_tablet_tool_pressure (input_settings,
+ tool->device_tool,
+ device, val);
+ }
+ }
+
value = val * TABLET_AXIS_MAX;
wl_resource_for_each (resource, &tool->focus_resource_list)