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.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2068>
This commit is contained in:
Carlos Garnacho 2021-10-29 12:29:51 +02:00 committed by Marge Bot
parent eb3075074a
commit 7bfc472ad3
2 changed files with 6 additions and 1 deletions

View File

@ -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;
/**

View File

@ -3496,6 +3496,7 @@ create_crossing_event (ClutterStage *stage,
ClutterInputDevice *device,
ClutterEventSequence *sequence,
ClutterEventType event_type,
ClutterEventFlags flags,
ClutterActor *source,
ClutterActor *related,
graphene_point_t coords,
@ -3505,7 +3506,7 @@ create_crossing_event (ClutterStage *stage,
event = clutter_event_new (event_type);
event->crossing.time = time_ms;
event->crossing.flags = 0;
event->crossing.flags = flags;
event->crossing.stage = stage;
event->crossing.source = source;
event->crossing.x = coords.x;
@ -3583,6 +3584,7 @@ clutter_stage_update_device (ClutterStage *stage,
event = create_crossing_event (stage,
device, sequence,
CLUTTER_LEAVE,
CLUTTER_EVENT_NONE,
old_actor, new_actor,
point, time_ms);
if (!_clutter_event_process_filters (event))
@ -3596,6 +3598,7 @@ clutter_stage_update_device (ClutterStage *stage,
event = create_crossing_event (stage,
device, sequence,
CLUTTER_ENTER,
CLUTTER_EVENT_NONE,
new_actor, old_actor,
point, time_ms);
if (!_clutter_event_process_filters (event))
@ -3776,6 +3779,7 @@ clutter_stage_notify_grab_on_pointer_entry (ClutterStage *stage,
entry->device,
entry->sequence,
event_type,
CLUTTER_EVENT_FLAG_GRAB_NOTIFY,
entry->current_actor,
event_type == CLUTTER_LEAVE ?
grab_actor : old_grab_actor,