[mutter/wip/wayland-clutter-events-2: 21/23] display: Invoke Wayland from the Grand Central Station callback
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/wayland-clutter-events-2: 21/23] display: Invoke Wayland from the Grand Central Station callback
- Date: Mon, 4 Nov 2013 16:20:20 +0000 (UTC)
commit e50a578ad3354b8a70cf85b5ed8fabd1e044cc9a
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Fri Oct 4 02:29:43 2013 -0400
display: Invoke Wayland from the Grand Central Station callback
src/core/display.c | 15 +++++++++++++--
src/wayland/meta-wayland-private.h | 2 ++
src/wayland/meta-wayland.c | 13 +++----------
3 files changed, 18 insertions(+), 12 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index 67e3cc4..3225ef5 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 0875fa7..140ce63 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 f0733ad..3f82569 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]