From 012c0a18efbb3a694de2e72af4948bc1ea03cbeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 10 Mar 2021 01:13:34 +0100 Subject: [PATCH] clutter: Ensure we always call handle_event_post for processed events Since commit 2ceac4a device-related X11 events aren't processed anymore, causing the input settings not to handle the devices. This is due to the fact that we may never call clutter_seat_handle_event_post() for such events. While this is always happening for the native backend, it doesn't happen in X11 because the events are removed from the queue as part of meta_x11_handle_event(), and thus no event was queued to the stage by the backend events source. This also makes sure that the event post handler is called after the event is actually processed, and not before an event is queued. Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1564 Part-of: --- clutter/clutter/clutter-main.c | 3 +++ src/backends/meta-backend.c | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/clutter/clutter/clutter-main.c b/clutter/clutter/clutter-main.c index 4b7b141e7..dd2198cca 100644 --- a/clutter/clutter/clutter-main.c +++ b/clutter/clutter/clutter-main.c @@ -1894,8 +1894,10 @@ _clutter_process_event (ClutterEvent *event) { ClutterMainContext *context; ClutterActor *stage; + ClutterSeat *seat; context = _clutter_context_get_default (); + seat = clutter_backend_get_default_seat (context->backend); stage = CLUTTER_ACTOR (event->any.stage); if (stage == NULL) @@ -1911,6 +1913,7 @@ _clutter_process_event (ClutterEvent *event) context->current_event = g_slist_prepend (context->current_event, event); _clutter_process_event_details (stage, context, event); + clutter_seat_handle_event_post (seat, event); context->current_event = g_slist_delete_link (context->current_event, context->current_event); } diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c index 0788cf102..9e525957e 100644 --- a/src/backends/meta-backend.c +++ b/src/backends/meta-backend.c @@ -991,17 +991,12 @@ clutter_source_dispatch (GSource *source, gpointer user_data) { MetaBackendSource *backend_source = (MetaBackendSource *) source; - MetaBackendPrivate *priv = - meta_backend_get_instance_private (backend_source->backend); ClutterEvent *event = clutter_event_get (); - ClutterSeat *seat; if (event) { event->any.stage = CLUTTER_STAGE (meta_backend_get_stage (backend_source->backend)); - seat = clutter_backend_get_default_seat (priv->clutter_backend); - clutter_seat_handle_event_post (seat, event); clutter_do_event (event); clutter_event_free (event); }