x11/cm: Stop using intermediate bypass_clutter variable

There is no need to use the 'bypass-*' method of event processing in the
changed function since in all cases the 'bypass-*' variable was set, any
following event processing functions would ignore the event anyway.
Simplify things a bit by just returning TRUE if the event is consumed.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2714>
This commit is contained in:
Jonas Ådahl 2022-03-14 22:15:30 +01:00 committed by Marge Bot
parent 1816f21e21
commit 28cbc213d0

View File

@ -379,21 +379,20 @@ meta_backend_x11_cm_lock_layout_group (MetaBackend *backend,
} }
static gboolean static gboolean
meta_backend_x11_cm_handle_host_xevent (MetaBackendX11 *backend_x11, meta_backend_x11_cm_handle_host_xevent (MetaBackendX11 *x11,
XEvent *event) XEvent *event)
{ {
MetaBackend *backend = META_BACKEND (backend_x11); MetaBackend *backend = META_BACKEND (x11);
MetaBackendX11 *x11 = META_BACKEND_X11 (backend); MetaContext *context = meta_backend_get_context (backend);
MetaBackendX11Cm *x11_cm = META_BACKEND_X11_CM (x11); MetaBackendX11Cm *x11_cm = META_BACKEND_X11_CM (x11);
MetaMonitorManager *monitor_manager = MetaMonitorManager *monitor_manager =
meta_backend_get_monitor_manager (backend); meta_backend_get_monitor_manager (backend);
MetaMonitorManagerXrandr *monitor_manager_xrandr = MetaMonitorManagerXrandr *monitor_manager_xrandr =
META_MONITOR_MANAGER_XRANDR (monitor_manager); META_MONITOR_MANAGER_XRANDR (monitor_manager);
Display *xdisplay = meta_backend_x11_get_xdisplay (x11); Display *xdisplay = meta_backend_x11_get_xdisplay (x11);
gboolean bypass_clutter = FALSE;
MetaDisplay *display; MetaDisplay *display;
display = meta_get_display (); display = meta_context_get_display (context);
if (display) if (display)
{ {
MetaCompositor *compositor = display->compositor; MetaCompositor *compositor = display->compositor;
@ -402,7 +401,7 @@ meta_backend_x11_cm_handle_host_xevent (MetaBackendX11 *backend_x11,
if (meta_dnd_handle_xdnd_event (backend, compositor_x11, if (meta_dnd_handle_xdnd_event (backend, compositor_x11,
xdisplay, event)) xdisplay, event))
bypass_clutter = TRUE; return TRUE;
} }
if (event->type == meta_backend_x11_get_xkb_event_base (x11)) if (event->type == meta_backend_x11_get_xkb_event_base (x11))
@ -427,10 +426,10 @@ meta_backend_x11_cm_handle_host_xevent (MetaBackendX11 *backend_x11,
} }
} }
bypass_clutter |= if (meta_monitor_manager_xrandr_handle_xevent (monitor_manager_xrandr, event))
meta_monitor_manager_xrandr_handle_xevent (monitor_manager_xrandr, event); return TRUE;
return bypass_clutter; return FALSE;
} }
static void static void