From 13330f34f38fed6d90723667a8ecd1a59f95328d Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Sat, 5 Feb 2022 13:11:06 +0100 Subject: [PATCH] backends: Add private call to update MetaBackend from a device We update some details like the last used device and pointer visibility from events, but this is done inconsistently on X11 since the ClutterEvents are created and pushed from an additional place. Make these updates happen on a private call, that will be called from these places in X11. Part-of: --- src/backends/meta-backend-private.h | 3 +++ src/backends/meta-backend.c | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/backends/meta-backend-private.h b/src/backends/meta-backend-private.h index 00ec8ba6a..e9e94e044 100644 --- a/src/backends/meta-backend-private.h +++ b/src/backends/meta-backend-private.h @@ -202,4 +202,7 @@ void meta_backend_remove_hw_cursor_inhibitor (MetaBackend *backend, gboolean meta_backend_is_hw_cursors_inhibited (MetaBackend *backend); +void meta_backend_update_from_event (MetaBackend *backend, + ClutterEvent *event); + #endif /* META_BACKEND_PRIVATE_H */ diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c index 4541507ad..cc08f5c48 100644 --- a/src/backends/meta-backend.c +++ b/src/backends/meta-backend.c @@ -1065,8 +1065,7 @@ clutter_source_dispatch (GSource *source, event->any.stage = CLUTTER_STAGE (meta_backend_get_stage (backend_source->backend)); clutter_do_event (event); - update_last_device_from_event (backend_source->backend, event); - update_pointer_visibility_from_event (backend_source->backend, event); + meta_backend_update_from_event (backend_source->backend, event); clutter_event_free (event); } @@ -1680,3 +1679,11 @@ meta_backend_is_hw_cursors_inhibited (MetaBackend *backend) return FALSE; } + +void +meta_backend_update_from_event (MetaBackend *backend, + ClutterEvent *event) +{ + update_last_device_from_event (backend, event); + update_pointer_visibility_from_event (backend, event); +}