[mutter/wip/carlosg/no-event-source: 2/10] core: Move away from clutter_event_get_source()




commit bc3aca4bbb1e0ef24939e7b33c65579a591f1c21
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Feb 25 13:04:37 2022 +0100

    core: Move away from clutter_event_get_source()
    
    Instead ask the stage for the target actor for the given device/sequence.

 src/core/events.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/core/events.c b/src/core/events.c
index 81911fd07c..2622b4c428 100644
--- a/src/core/events.c
+++ b/src/core/events.c
@@ -86,15 +86,17 @@ get_window_for_event (MetaDisplay        *display,
     {
     case META_EVENT_ROUTE_NORMAL:
       {
-        ClutterActor *source;
+        ClutterActor *target;
         MetaWindowActor *window_actor;
 
         /* Always use the key focused window for key events. */
         if (IS_KEY_EVENT (event))
             return stage_has_key_focus () ? display->focus_window : NULL;
 
-        source = clutter_event_get_source (event);
-        window_actor = meta_window_actor_from_actor (source);
+        target = clutter_stage_get_device_actor (clutter_event_get_stage (event),
+                                                 clutter_event_get_device (event),
+                                                 clutter_event_get_event_sequence (event));
+        window_actor = meta_window_actor_from_actor (target);
         if (window_actor)
           return meta_window_actor_get_meta_window (window_actor);
         else


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