[mutter/wip/wayland-clutter-events-2: 19/19] 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: 19/19] display: Invoke Wayland from the Grand Central Station callback
- Date: Sat, 5 Oct 2013 14:16:24 +0000 (UTC)
commit b4dfe5b5a3a7c3b8857f66bf49208d6f78b10d7a
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 | 18 ++++++++++++++++--
src/wayland/meta-wayland-private.h | 2 ++
src/wayland/meta-wayland.c | 13 +++----------
3 files changed, 21 insertions(+), 12 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index 60c7673..a36b926 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -2228,6 +2228,7 @@ meta_display_handle_event (MetaDisplay *display,
{
MetaWindow *window;
gboolean frame_was_receiver;
+ gboolean handled;
window = get_window_for_actor (event->any.source, &frame_was_receiver);
@@ -2466,7 +2467,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;
@@ -2476,7 +2477,20 @@ meta_display_handle_event (MetaDisplay *display,
break;
}
- return FALSE;
+ handled = (display->grab_op != META_GRAB_OP_NONE);
+
+#ifdef HAVE_WAYLAND
+ if (!handled)
+ {
+ MetaWaylandCompositor *compositor;
+ compositor = meta_wayland_compositor_get_default ();
+
+ if (meta_wayland_compositor_handle_event (compositor, event))
+ handled = TRUE;
+ }
+#endif /* HAVE_WAYLAND */
+
+ return handled;
}
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]