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
This commit is contained in:
Gayan Perera 2012-12-27 18:34:12 +05:30 committed by Jasper St. Pierre
parent fb0cd80332
commit 6b5cf2eb61
4 changed files with 30 additions and 3 deletions

View File

@ -38,7 +38,7 @@ struct _MetaCompScreen
{ {
MetaScreen *screen; MetaScreen *screen;
ClutterActor *stage, *window_group, *overlay_group; ClutterActor *stage, *window_group, *top_window_group, *overlay_group;
ClutterActor *background_actor; ClutterActor *background_actor;
GList *windows; GList *windows;
GHashTable *windows_by_xid; GHashTable *windows_by_xid;

View File

@ -237,6 +237,23 @@ meta_get_window_group_for_screen (MetaScreen *screen)
return info->window_group; return info->window_group;
} }
/**
* 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: * meta_get_background_actor_for_screen:
* @screen: a #MetaScreen * @screen: a #MetaScreen
@ -588,6 +605,7 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
} }
info->window_group = meta_window_group_new (screen); 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->background_actor = meta_background_actor_new_for_screen (screen);
info->overlay_group = clutter_group_new (); info->overlay_group = clutter_group_new ();
@ -597,6 +615,7 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
clutter_container_add (CLUTTER_CONTAINER (info->stage), clutter_container_add (CLUTTER_CONTAINER (info->stage),
info->window_group, info->window_group,
info->top_window_group,
info->overlay_group, info->overlay_group,
NULL); NULL);

View File

@ -1524,6 +1524,7 @@ meta_window_actor_new (MetaWindow *window)
MetaWindowActorPrivate *priv; MetaWindowActorPrivate *priv;
MetaFrame *frame; MetaFrame *frame;
Window top_window; Window top_window;
ClutterActor *window_group;
frame = meta_window_get_frame (window); frame = meta_window_get_frame (window);
if (frame) if (frame)
@ -1556,8 +1557,14 @@ meta_window_actor_new (MetaWindow *window)
/* Hang our compositor window state off the MetaWindow for fast retrieval */ /* Hang our compositor window state off the MetaWindow for fast retrieval */
meta_window_set_compositor_private (window, G_OBJECT (self)); meta_window_set_compositor_private (window, G_OBJECT (self));
clutter_container_add_actor (CLUTTER_CONTAINER (info->window_group), if (window->layer == META_LAYER_OVERRIDE_REDIRECT)
CLUTTER_ACTOR (self)); 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)); clutter_actor_hide (CLUTTER_ACTOR (self));
/* Initial position in the stack is arbitrary; stacking will be synced /* Initial position in the stack is arbitrary; stacking will be synced

View File

@ -39,6 +39,7 @@ ClutterActor *meta_get_overlay_group_for_screen (MetaScreen *screen);
Window meta_get_overlay_window (MetaScreen *screen); Window meta_get_overlay_window (MetaScreen *screen);
GList *meta_get_window_actors (MetaScreen *screen); GList *meta_get_window_actors (MetaScreen *screen);
ClutterActor *meta_get_window_group_for_screen (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_disable_unredirect_for_screen (MetaScreen *screen);
void meta_enable_unredirect_for_screen (MetaScreen *screen); void meta_enable_unredirect_for_screen (MetaScreen *screen);