mirror of
https://github.com/brl/mutter.git
synced 2025-01-27 03:49:03 +00:00
clutter: Propagate events only inside the grab
The grab actor becomes the "root" of the events being handled, events inside propagate normally, but become silenced when falling outside the grab area. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2068>
This commit is contained in:
parent
ba895ca8e2
commit
ec3b8fe85b
@ -683,7 +683,9 @@ emit_event_chain (ClutterEvent *event)
|
||||
return;
|
||||
}
|
||||
|
||||
_clutter_actor_handle_event (event->any.source, NULL, event);
|
||||
_clutter_actor_handle_event (event->any.source,
|
||||
clutter_stage_get_grab_actor (event->any.stage),
|
||||
event);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3846,3 +3846,15 @@ clutter_grab_dismiss (ClutterGrab *grab)
|
||||
|
||||
g_free (grab);
|
||||
}
|
||||
|
||||
ClutterActor *
|
||||
clutter_stage_get_grab_actor (ClutterStage *stage)
|
||||
{
|
||||
ClutterStagePrivate *priv = stage->priv;
|
||||
|
||||
if (!priv->topmost_grab)
|
||||
return NULL;
|
||||
|
||||
/* Return active grab */
|
||||
return priv->topmost_grab->actor;
|
||||
}
|
||||
|
@ -274,6 +274,9 @@ CLUTTER_EXPORT
|
||||
ClutterGrab * clutter_stage_grab (ClutterStage *stage,
|
||||
ClutterActor *actor);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterActor * clutter_stage_get_grab_actor (ClutterStage *stage);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_STAGE_H__ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user