diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2020-08-11 16:27:35 +0200 |
---|---|---|
committer | Marge Bot <marge-bot@gnome.org> | 2020-11-27 15:14:33 +0000 |
commit | 2c1558ddbd04a9eaee97d717ca81d2957e045f15 (patch) | |
tree | 2d7c71edc823c7aa1356cd993c59205a80a3a006 /src/backends/x11/meta-seat-x11.c | |
parent | fe9092da1972e520bd56dfa88a1080e7b72283b8 (diff) | |
download | mutter-2c1558ddbd04a9eaee97d717ca81d2957e045f15.tar.gz |
backends: Make device tracking at MetaInputSettings ad-hoc API
Depending on the backend, we want to integrate this object at different
levels. It will sit close to the MetaBackendX11/MetaSeatX11 in X11, but
it will be put deep down with MetaSeatImpl in the native backend, in a
separate thread.
Since we can't depend on a single object type, nor are able to track
ClutterSeat signals neatly, make this API something to be called
explicitly by backends.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
Diffstat (limited to 'src/backends/x11/meta-seat-x11.c')
-rw-r--r-- | src/backends/x11/meta-seat-x11.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/backends/x11/meta-seat-x11.c b/src/backends/x11/meta-seat-x11.c index 4437a247a..24d6369b8 100644 --- a/src/backends/x11/meta-seat-x11.c +++ b/src/backends/x11/meta-seat-x11.c @@ -21,6 +21,7 @@ #include <X11/extensions/XInput2.h> #include <X11/extensions/XKB.h> +#include "backends/meta-input-settings-private.h" #include "backends/x11/meta-backend-x11.h" #include "backends/x11/meta-event-x11.h" #include "backends/x11/meta-input-device-tool-x11.h" @@ -725,6 +726,7 @@ meta_seat_x11_handle_event_post (ClutterSeat *seat, { MetaSeatX11 *seat_x11 = META_SEAT_X11 (seat); ClutterInputDevice *device; + MetaInputSettings *input_settings; gboolean is_touch; if (event->type != CLUTTER_DEVICE_ADDED && @@ -734,15 +736,18 @@ meta_seat_x11_handle_event_post (ClutterSeat *seat, device = clutter_event_get_device (event); is_touch = clutter_input_device_get_device_type (device) == CLUTTER_TOUCHSCREEN_DEVICE; + input_settings = meta_backend_get_input_settings (meta_get_backend ()); switch (event->type) { case CLUTTER_DEVICE_ADDED: + meta_input_settings_add_device (input_settings, device); seat_x11->has_touchscreens |= is_touch; break; case CLUTTER_DEVICE_REMOVED: if (is_touch) seat_x11->has_touchscreens = has_touchscreens (seat_x11); + meta_input_settings_remove_device (input_settings, device); break; default: break; @@ -939,6 +944,7 @@ translate_property_event (MetaSeatX11 *seat_x11, { ClutterInputDeviceTool *tool = NULL; ClutterInputDeviceToolType type; + MetaInputSettings *input_settings; int serial_id; serial_id = device_get_tool_serial (device); @@ -959,7 +965,8 @@ 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); + input_settings = meta_backend_get_input_settings (meta_get_backend ()); + meta_input_settings_notify_tool_change (input_settings, device, tool); if (tool) clutter_input_device_update_from_tool (device, tool); |