mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
display: Invoke Wayland from the Grand Central Station callback
This commit is contained in:
parent
6cc014a941
commit
648639fffe
@ -2461,7 +2461,7 @@ meta_display_handle_event (MetaDisplay *display,
|
|||||||
* we can get into a confused state. So if a keybinding is
|
* 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
|
* 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
|
* 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))
|
if (meta_display_process_key_event (display, window, (ClutterKeyEvent *) event))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -2470,7 +2470,18 @@ meta_display_handle_event (MetaDisplay *display,
|
|||||||
break;
|
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
|
static gboolean
|
||||||
|
@ -96,6 +96,8 @@ void meta_wayland_compositor_repick (MetaWaylandComp
|
|||||||
|
|
||||||
void meta_wayland_compositor_set_input_focus (MetaWaylandCompositor *compositor,
|
void meta_wayland_compositor_set_input_focus (MetaWaylandCompositor *compositor,
|
||||||
MetaWindow *window);
|
MetaWindow *window);
|
||||||
|
gboolean meta_wayland_compositor_handle_event (MetaWaylandCompositor *compositor,
|
||||||
|
const ClutterEvent *event);
|
||||||
|
|
||||||
MetaLauncher *meta_wayland_compositor_get_launcher (MetaWaylandCompositor *compositor);
|
MetaLauncher *meta_wayland_compositor_get_launcher (MetaWaylandCompositor *compositor);
|
||||||
gboolean meta_wayland_compositor_is_native (MetaWaylandCompositor *compositor);
|
gboolean meta_wayland_compositor_is_native (MetaWaylandCompositor *compositor);
|
||||||
|
@ -561,13 +561,10 @@ reset_idletimes (const ClutterEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
gboolean
|
||||||
event_filter_cb (const ClutterEvent *event,
|
meta_wayland_compositor_handle_event (MetaWaylandCompositor *compositor,
|
||||||
gpointer user_data)
|
const ClutterEvent *event)
|
||||||
{
|
{
|
||||||
MetaWaylandCompositor *compositor = user_data;
|
|
||||||
MetaWaylandSeat *seat = compositor->seat;
|
|
||||||
|
|
||||||
reset_idletimes (event);
|
reset_idletimes (event);
|
||||||
|
|
||||||
return meta_wayland_seat_handle_event (compositor->seat, event);
|
return meta_wayland_seat_handle_event (compositor->seat, event);
|
||||||
@ -701,8 +698,6 @@ meta_wayland_init (void)
|
|||||||
compositor->seat = meta_wayland_seat_new (compositor->wayland_display,
|
compositor->seat = meta_wayland_seat_new (compositor->wayland_display,
|
||||||
compositor->drm_fd >= 0);
|
compositor->drm_fd >= 0);
|
||||||
|
|
||||||
clutter_event_add_filter (event_filter_cb, compositor);
|
|
||||||
|
|
||||||
meta_wayland_init_shell (compositor);
|
meta_wayland_init_shell (compositor);
|
||||||
|
|
||||||
clutter_actor_show (compositor->stage);
|
clutter_actor_show (compositor->stage);
|
||||||
@ -739,8 +734,6 @@ meta_wayland_finalize (void)
|
|||||||
|
|
||||||
compositor = meta_wayland_compositor_get_default ();
|
compositor = meta_wayland_compositor_get_default ();
|
||||||
|
|
||||||
clutter_event_remove_filter (event_filter_cb, compositor);
|
|
||||||
|
|
||||||
meta_xwayland_stop (compositor);
|
meta_xwayland_stop (compositor);
|
||||||
g_clear_object (&compositor->launcher);
|
g_clear_object (&compositor->launcher);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user