summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2020-10-23 23:51:42 +0200
committerMarge Bot <marge-bot@gnome.org>2020-11-27 15:14:33 +0000
commitc601a824e94d2903e126760c35775332afe6085c (patch)
tree4fbff4f41137147f4b0ad714e329138613069a9c
parent89a140d6187c8d90bff76841cd8949f25fdcd95c (diff)
downloadmutter-c601a824e94d2903e126760c35775332afe6085c.tar.gz
clutter: Update device for the current tool in backends
This should happen deeper in backends, not here in clutter-main. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
-rw-r--r--clutter/clutter/clutter-main.c3
-rw-r--r--src/backends/native/meta-seat-impl.c3
-rw-r--r--src/backends/x11/meta-seat-x11.c3
3 files changed, 6 insertions, 3 deletions
diff --git a/clutter/clutter/clutter-main.c b/clutter/clutter/clutter-main.c
index 9ac6d53bf..706fb430a 100644
--- a/clutter/clutter/clutter-main.c
+++ b/clutter/clutter/clutter-main.c
@@ -1912,9 +1912,6 @@ _clutter_process_event_details (ClutterActor *stage,
case CLUTTER_PROXIMITY_IN:
case CLUTTER_PROXIMITY_OUT:
- clutter_input_device_update_from_tool (clutter_event_get_source_device (event),
- clutter_event_get_device_tool (event));
-
if (_clutter_event_process_filters (event))
break;
diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c
index 32773a478..7329568f9 100644
--- a/src/backends/native/meta-seat-impl.c
+++ b/src/backends/native/meta-seat-impl.c
@@ -1656,6 +1656,9 @@ input_device_update_tool (ClutterInputDevice *input_device,
if (evdev_device->last_tool != tool)
{
+ if (tool)
+ clutter_input_device_update_from_tool (input_device, tool);
+
evdev_device->last_tool = tool;
g_signal_emit_by_name (seat_impl->seat_native, "tool-changed",
input_device, tool);
diff --git a/src/backends/x11/meta-seat-x11.c b/src/backends/x11/meta-seat-x11.c
index f437ef16d..4437a247a 100644
--- a/src/backends/x11/meta-seat-x11.c
+++ b/src/backends/x11/meta-seat-x11.c
@@ -960,6 +960,9 @@ translate_property_event (MetaSeatX11 *seat_x11,
meta_input_device_x11_update_tool (device, tool);
g_signal_emit_by_name (seat_x11, "tool-changed", device, tool);
+
+ if (tool)
+ clutter_input_device_update_from_tool (device, tool);
}
}