mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 18:11:05 -05:00
clutter: Set event as current_event when going through event filters
With the introduction of untrottled event delivery to wayland clients, we moved the _clutter_event_process_filters() call outside of _clutter_process_event(). This also moved the processing of event filters outside of the timespan where the event is added to Clutters current_event stack, making Clutter.get_current_event() no longer available to anything happening inside mutters event filter. One thing that happens in mutters event filter is detecting and triggering keybindings like the alt-tab switcher. Now the alt-tab switcher has a special case where it finishes and activates a window right when the keybinding gets activated, relying on the current event time as the timestamp to activate the window. Now since the current event time is no longer available from inside mutters event filter, we'd pass 0 to meta_window_activate(), causing mutter to send a notification instead of actually activating the window. To fix this, also set a current_event for the ClutterContext when going through event filters, this makes sure Clutter.get_current_event_time() works when called inside keybinding handlers. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2327>
This commit is contained in:
parent
91ae72acdf
commit
4a865424cd
@ -741,6 +741,7 @@ update_device_for_event (ClutterStage *stage,
|
||||
void
|
||||
clutter_do_event (ClutterEvent *event)
|
||||
{
|
||||
ClutterContext *context = _clutter_context_get_default();
|
||||
ClutterActor *event_actor = NULL;
|
||||
|
||||
/* we need the stage for the event */
|
||||
@ -775,8 +776,17 @@ clutter_do_event (ClutterEvent *event)
|
||||
event_actor = clutter_stage_get_event_actor (event->any.stage, event);
|
||||
}
|
||||
|
||||
context->current_event = g_slist_prepend (context->current_event, event);
|
||||
|
||||
if (_clutter_event_process_filters (event, event_actor))
|
||||
return;
|
||||
{
|
||||
context->current_event =
|
||||
g_slist_delete_link (context->current_event, context->current_event);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
context->current_event = g_slist_delete_link (context->current_event, context->current_event);
|
||||
|
||||
/* Instead of processing events when received, we queue them up to
|
||||
* handle per-frame before animations, layout, and drawing.
|
||||
|
Loading…
Reference in New Issue
Block a user