[mutter/wip/carlosg/grabs-pt1: 14/16] clutter: Add specific event flag to tag "grab notify" crossing events




commit 07e9c5eee66782f80ae567a1fcbe805f7de7a8b4
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Oct 29 12:29:51 2021 +0200

    clutter: Add specific event flag to tag "grab notify" crossing events
    
    These events may need some differentiation or special handling, so add
    this event flag and set it in the relevant events.

 clutter/clutter/clutter-enums.h | 1 +
 clutter/clutter/clutter-stage.c | 8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/clutter/clutter/clutter-enums.h b/clutter/clutter/clutter-enums.h
index 0c889d1482..e8c10a819c 100644
--- a/clutter/clutter/clutter-enums.h
+++ b/clutter/clutter/clutter-enums.h
@@ -804,6 +804,7 @@ typedef enum /*< flags prefix=CLUTTER_EVENT >*/
   CLUTTER_EVENT_FLAG_INPUT_METHOD = 1 << 1,
   CLUTTER_EVENT_FLAG_REPEATED     = 1 << 2,
   CLUTTER_EVENT_FLAG_RELATIVE_MOTION = 1 << 3,
+  CLUTTER_EVENT_FLAG_GRAB_NOTIFY  = 1 << 4,
 } ClutterEventFlags;
 
 /**
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
index 88cfb44f7f..5d14d2ac51 100644
--- a/clutter/clutter/clutter-stage.c
+++ b/clutter/clutter/clutter-stage.c
@@ -3477,6 +3477,7 @@ create_crossing_event (ClutterStage         *stage,
                        ClutterInputDevice   *device,
                        ClutterEventSequence *sequence,
                        ClutterEventType      event_type,
+                       ClutterEventFlags     flags,
                        ClutterActor         *source,
                        ClutterActor         *related,
                        graphene_point_t      coords,
@@ -3486,7 +3487,7 @@ create_crossing_event (ClutterStage         *stage,
 
   event = clutter_event_new (event_type);
   event->crossing.time = time;
-  event->crossing.flags = 0;
+  event->crossing.flags = flags;
   event->crossing.stage = stage;
   event->crossing.source = source;
   event->crossing.x = coords.x;
@@ -3541,7 +3542,7 @@ clutter_stage_update_device (ClutterStage         *stage,
         {
           event = create_crossing_event (stage,
                                          device, sequence,
-                                         CLUTTER_LEAVE,
+                                         CLUTTER_LEAVE, 0,
                                          old_actor, new_actor,
                                          point, time);
           _clutter_actor_handle_event (old_actor,
@@ -3554,7 +3555,7 @@ clutter_stage_update_device (ClutterStage         *stage,
         {
           event = create_crossing_event (stage,
                                          device, sequence,
-                                         CLUTTER_ENTER,
+                                         CLUTTER_ENTER, 0,
                                          new_actor, old_actor,
                                          point, time);
           _clutter_actor_handle_event (new_actor,
@@ -3670,6 +3671,7 @@ clutter_stage_notify_grab_on_entry (ClutterStage       *stage,
                                      entry->device,
                                      entry->sequence,
                                      event_type,
+                                     CLUTTER_EVENT_FLAG_GRAB_NOTIFY,
                                      entry->current_actor,
                                      entry->current_actor,
                                      entry->coords,


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