[mutter/wip/carlosg/there-can-be-only-one: 149/151] backends: Add private call to update MetaBackend from a device




commit c9c7bde6068f13688ff30fca192ad81ed2d4068c
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Feb 5 13:11:06 2022 +0100

    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.

 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 00ec8ba6a9..e9e94e044d 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 0b8f770b98..72a22bd17b 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);
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]