[mutter/wip/dnd-surface3: 7/11] compositor: Add A "feedback" window group
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/dnd-surface3: 7/11] compositor: Add A "feedback" window group
- Date: Mon, 6 Oct 2014 15:12:34 +0000 (UTC)
commit ad560999be0eae89f66d0cd96973156677133447
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Oct 6 16:46:26 2014 +0200
compositor: Add A "feedback" window group
Although not strictly a window group... This ClutterActor is
meant to stay always on top, and only show non-reactive actors
created by Mutter itself. Two possible usecases for this layer
are DnD surfaces, and touch spots.
src/compositor/compositor-private.h | 2 +-
src/compositor/compositor.c | 14 ++++++++++++++
2 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/src/compositor/compositor-private.h b/src/compositor/compositor-private.h
index a41f563..80fb4e2 100644
--- a/src/compositor/compositor-private.h
+++ b/src/compositor/compositor-private.h
@@ -23,7 +23,7 @@ struct _MetaCompositor
guint server_time_is_monotonic_time : 1;
guint no_mipmaps : 1;
- ClutterActor *stage, *window_group, *top_window_group;
+ ClutterActor *stage, *window_group, *top_window_group, *feedback_group;
ClutterActor *background_actor;
GList *windows;
Window output;
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
index 47bea31..6493dbe 100644
--- a/src/compositor/compositor.c
+++ b/src/compositor/compositor.c
@@ -449,6 +449,15 @@ redirect_windows (MetaScreen *screen)
}
}
+static void
+compositor_stage_actor_added (ClutterActor *actor,
+ ClutterActor *child,
+ MetaCompositor *compositor)
+{
+ /* Ensure the feedback group stays topmost */
+ clutter_actor_set_child_at_index (actor, compositor->feedback_group, -1);
+}
+
void
meta_compositor_manage (MetaCompositor *compositor)
{
@@ -478,9 +487,14 @@ meta_compositor_manage (MetaCompositor *compositor)
compositor->window_group = meta_window_group_new (screen);
compositor->top_window_group = meta_window_group_new (screen);
+ compositor->feedback_group = meta_window_group_new (screen);
clutter_actor_add_child (compositor->stage, compositor->window_group);
clutter_actor_add_child (compositor->stage, compositor->top_window_group);
+ clutter_actor_add_child (compositor->stage, compositor->feedback_group);
+
+ g_signal_connect (compositor->stage, "actor-added",
+ G_CALLBACK (compositor_stage_actor_added), compositor);
if (meta_is_wayland_compositor ())
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]