diff --git a/src/core/display.c b/src/core/display.c index 67e3cc4cc..3225ef586 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -2461,7 +2461,7 @@ meta_display_handle_event (MetaDisplay *display, * we can get into a confused state. So if a keybinding is * handled (because it's one of our hot-keys, or because we are * in a keyboard-grabbed mode like moving a window, we don't - * want to pass the key event to the compositor or GTK+ at all. + * want to pass the key event to the compositor or Wayland at all. */ if (meta_display_process_key_event (display, window, (ClutterKeyEvent *) event)) return TRUE; @@ -2470,7 +2470,18 @@ meta_display_handle_event (MetaDisplay *display, break; } - return FALSE; +#ifdef HAVE_WAYLAND + if (meta_is_wayland_compositor() && display->grab_op != META_GRAB_OP_NONE) + { + MetaWaylandCompositor *compositor; + compositor = meta_wayland_compositor_get_default (); + + if (meta_wayland_compositor_handle_event (compositor, event)) + return TRUE; + } +#endif /* HAVE_WAYLAND */ + + return (display->grab_op != META_GRAB_OP_COMPOSITOR); } static gboolean diff --git a/src/wayland/meta-wayland-private.h b/src/wayland/meta-wayland-private.h index 0875fa700..140ce63cf 100644 --- a/src/wayland/meta-wayland-private.h +++ b/src/wayland/meta-wayland-private.h @@ -96,6 +96,8 @@ void meta_wayland_compositor_repick (MetaWaylandComp void meta_wayland_compositor_set_input_focus (MetaWaylandCompositor *compositor, MetaWindow *window); +gboolean meta_wayland_compositor_handle_event (MetaWaylandCompositor *compositor, + const ClutterEvent *event); MetaLauncher *meta_wayland_compositor_get_launcher (MetaWaylandCompositor *compositor); gboolean meta_wayland_compositor_is_native (MetaWaylandCompositor *compositor); diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c index f0733ad3f..3f8256930 100644 --- a/src/wayland/meta-wayland.c +++ b/src/wayland/meta-wayland.c @@ -558,13 +558,10 @@ reset_idletimes (const ClutterEvent *event) } } -static gboolean -event_filter_cb (const ClutterEvent *event, - gpointer user_data) +gboolean +meta_wayland_compositor_handle_event (MetaWaylandCompositor *compositor, + const ClutterEvent *event) { - MetaWaylandCompositor *compositor = user_data; - MetaWaylandSeat *seat = compositor->seat; - reset_idletimes (event); return meta_wayland_seat_handle_event (compositor->seat, event); @@ -698,8 +695,6 @@ meta_wayland_init (void) compositor->seat = meta_wayland_seat_new (compositor->wayland_display, compositor->drm_fd >= 0); - clutter_event_add_filter (event_filter_cb, compositor); - meta_wayland_init_shell (compositor); clutter_actor_show (compositor->stage); @@ -736,8 +731,6 @@ meta_wayland_finalize (void) compositor = meta_wayland_compositor_get_default (); - clutter_event_remove_filter (event_filter_cb, compositor); - meta_xwayland_stop (compositor); g_clear_object (&compositor->launcher); }