[mutter] compositor: Add a new window group for override-redirect windows
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] compositor: Add a new window group for override-redirect windows
- Date: Thu, 14 Feb 2013 18:47:09 +0000 (UTC)
commit 6b5cf2eb6123a7faf148f0d075408545850936bb
Author: Gayan Perera <gayanper gmail com>
Date: Thu Dec 27 18:34:12 2012 +0530
compositor: Add a new window group for override-redirect windows
Put override redirect windows such as menus into a separate window group
stacked above everything else. This will allow us to visually put these
above other compositior chrome.
Based on a patch from Muffin.
https://bugzilla.gnome.org/show_bug.cgi?id=633620
src/compositor/compositor-private.h | 2 +-
src/compositor/compositor.c | 19 +++++++++++++++++++
src/compositor/meta-window-actor.c | 11 +++++++++--
src/meta/compositor-mutter.h | 1 +
4 files changed, 30 insertions(+), 3 deletions(-)
---
diff --git a/src/compositor/compositor-private.h b/src/compositor/compositor-private.h
index 0176d10..acb8d3c 100644
--- a/src/compositor/compositor-private.h
+++ b/src/compositor/compositor-private.h
@@ -38,7 +38,7 @@ struct _MetaCompScreen
{
MetaScreen *screen;
- ClutterActor *stage, *window_group, *overlay_group;
+ ClutterActor *stage, *window_group, *top_window_group, *overlay_group;
ClutterActor *background_actor;
GList *windows;
GHashTable *windows_by_xid;
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
index 3cc6c9c..91b0767 100644
--- a/src/compositor/compositor.c
+++ b/src/compositor/compositor.c
@@ -238,6 +238,23 @@ meta_get_window_group_for_screen (MetaScreen *screen)
}
/**
+ * meta_get_top_window_group_for_screen:
+ * @screen: a #MetaScreen
+ *
+ * Returns: (transfer none): The top window group corresponding to @screen
+ */
+ClutterActor *
+meta_get_top_window_group_for_screen (MetaScreen *screen)
+{
+ MetaCompScreen *info = meta_screen_get_compositor_data (screen);
+
+ if (!info)
+ return NULL;
+
+ return info->top_window_group;
+}
+
+/**
* meta_get_background_actor_for_screen:
* @screen: a #MetaScreen
*
@@ -588,6 +605,7 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
}
info->window_group = meta_window_group_new (screen);
+ info->top_window_group = meta_window_group_new (screen);
info->background_actor = meta_background_actor_new_for_screen (screen);
info->overlay_group = clutter_group_new ();
@@ -597,6 +615,7 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
clutter_container_add (CLUTTER_CONTAINER (info->stage),
info->window_group,
+ info->top_window_group,
info->overlay_group,
NULL);
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index f28452e..9980fe6 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -1524,6 +1524,7 @@ meta_window_actor_new (MetaWindow *window)
MetaWindowActorPrivate *priv;
MetaFrame *frame;
Window top_window;
+ ClutterActor *window_group;
frame = meta_window_get_frame (window);
if (frame)
@@ -1556,8 +1557,14 @@ meta_window_actor_new (MetaWindow *window)
/* Hang our compositor window state off the MetaWindow for fast retrieval */
meta_window_set_compositor_private (window, G_OBJECT (self));
- clutter_container_add_actor (CLUTTER_CONTAINER (info->window_group),
- CLUTTER_ACTOR (self));
+ if (window->layer == META_LAYER_OVERRIDE_REDIRECT)
+ window_group = info->top_window_group;
+ else
+ window_group = info->window_group;
+
+ clutter_container_add_actor (CLUTTER_CONTAINER (window_group),
+ CLUTTER_ACTOR (self));
+
clutter_actor_hide (CLUTTER_ACTOR (self));
/* Initial position in the stack is arbitrary; stacking will be synced
diff --git a/src/meta/compositor-mutter.h b/src/meta/compositor-mutter.h
index e196c65..161cfad 100644
--- a/src/meta/compositor-mutter.h
+++ b/src/meta/compositor-mutter.h
@@ -39,6 +39,7 @@ ClutterActor *meta_get_overlay_group_for_screen (MetaScreen *screen);
Window meta_get_overlay_window (MetaScreen *screen);
GList *meta_get_window_actors (MetaScreen *screen);
ClutterActor *meta_get_window_group_for_screen (MetaScreen *screen);
+ClutterActor *meta_get_top_window_group_for_screen (MetaScreen *screen);
void meta_disable_unredirect_for_screen (MetaScreen *screen);
void meta_enable_unredirect_for_screen (MetaScreen *screen);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]