Instead of hiding/showing the actors of hidden windows, reparent, it's more reliable
It's more awkward and error prone, considering plugin ininteractions, to simply show/hide the actors of hidden windows, and it seems to be more reliable to reparent them to a hidden group instead.
This commit is contained in:
parent
0058271aaa
commit
93b945ea42
@ -142,6 +142,7 @@ typedef struct _MetaCompScreen
|
|||||||
MetaScreen *screen;
|
MetaScreen *screen;
|
||||||
|
|
||||||
ClutterActor *stage, *window_group, *overlay_group;
|
ClutterActor *stage, *window_group, *overlay_group;
|
||||||
|
ClutterActor *hidden_group;
|
||||||
GList *windows;
|
GList *windows;
|
||||||
GHashTable *windows_by_xid;
|
GHashTable *windows_by_xid;
|
||||||
MetaWindow *focus_window;
|
MetaWindow *focus_window;
|
||||||
@ -1952,12 +1953,15 @@ clutter_cmp_manage_screen (MetaCompositor *compositor,
|
|||||||
g_object_set_property (G_OBJECT (info->window_group),
|
g_object_set_property (G_OBJECT (info->window_group),
|
||||||
"show-on-set-parent", FALSE);
|
"show-on-set-parent", FALSE);
|
||||||
info->overlay_group = clutter_group_new ();
|
info->overlay_group = clutter_group_new ();
|
||||||
|
info->hidden_group = clutter_group_new ();
|
||||||
|
|
||||||
clutter_container_add (CLUTTER_CONTAINER (info->stage),
|
clutter_container_add (CLUTTER_CONTAINER (info->stage),
|
||||||
info->window_group,
|
info->window_group,
|
||||||
info->overlay_group,
|
info->overlay_group,
|
||||||
|
info->hidden_group,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
clutter_actor_hide (info->hidden_group);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Must do this *before* creating the plugin manager, in case any of the
|
* Must do this *before* creating the plugin manager, in case any of the
|
||||||
@ -2435,17 +2439,24 @@ clutter_cmp_set_window_hidden (MetaCompositor *compositor,
|
|||||||
gboolean hidden)
|
gboolean hidden)
|
||||||
{
|
{
|
||||||
MutterWindow *cw = window->compositor_private;
|
MutterWindow *cw = window->compositor_private;
|
||||||
|
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||||
|
|
||||||
g_return_if_fail (cw);
|
g_return_if_fail (cw);
|
||||||
|
|
||||||
if (hidden)
|
if (hidden)
|
||||||
{
|
{
|
||||||
/* FIXME: There needs to be a way to queue this if there is an effect
|
/* FIXME: There needs to be a way to queue this if there is an effect
|
||||||
* in progress for this window */
|
* in progress for this window */
|
||||||
clutter_actor_hide (CLUTTER_ACTOR (cw));
|
if (clutter_actor_get_parent (CLUTTER_ACTOR (cw)) != info->hidden_group)
|
||||||
|
clutter_actor_reparent (CLUTTER_ACTOR (cw),
|
||||||
|
info->hidden_group);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
clutter_actor_show (CLUTTER_ACTOR (cw));
|
{
|
||||||
|
if (clutter_actor_get_parent (CLUTTER_ACTOR (cw)) != info->window_group)
|
||||||
|
clutter_actor_reparent (CLUTTER_ACTOR (cw),
|
||||||
|
info->window_group);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static MetaCompositor comp_info = {
|
static MetaCompositor comp_info = {
|
||||||
|
@ -2254,12 +2254,12 @@ meta_window_show (MetaWindow *window)
|
|||||||
{
|
{
|
||||||
meta_stack_freeze (window->screen->stack);
|
meta_stack_freeze (window->screen->stack);
|
||||||
window->hidden = FALSE;
|
window->hidden = FALSE;
|
||||||
meta_stack_thaw (window->screen->stack);
|
|
||||||
/* Inform the compositor that the window isn't hidden */
|
/* Inform the compositor that the window isn't hidden */
|
||||||
meta_compositor_set_window_hidden (window->display->compositor,
|
meta_compositor_set_window_hidden (window->display->compositor,
|
||||||
window->screen,
|
window->screen,
|
||||||
window,
|
window,
|
||||||
window->hidden);
|
window->hidden);
|
||||||
|
meta_stack_thaw (window->screen->stack);
|
||||||
did_show = TRUE;
|
did_show = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2344,12 +2344,12 @@ meta_window_hide (MetaWindow *window)
|
|||||||
|
|
||||||
meta_stack_freeze (window->screen->stack);
|
meta_stack_freeze (window->screen->stack);
|
||||||
window->hidden = TRUE;
|
window->hidden = TRUE;
|
||||||
meta_stack_thaw (window->screen->stack);
|
|
||||||
/* Tell the compositor this window is now hidden */
|
/* Tell the compositor this window is now hidden */
|
||||||
meta_compositor_set_window_hidden (window->display->compositor,
|
meta_compositor_set_window_hidden (window->display->compositor,
|
||||||
window->screen,
|
window->screen,
|
||||||
window,
|
window,
|
||||||
window->hidden);
|
window->hidden);
|
||||||
|
meta_stack_thaw (window->screen->stack);
|
||||||
|
|
||||||
did_hide = TRUE;
|
did_hide = TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user