Re-works the approach to supporting live preview to handle stacking.
We can't easily use a metacity layer to hide windows as that means we loose our original stacking position. (Metacity's stack positions are only valid within a single layer) We now have a "guard window" per screen that is a fullscreen override redirect that is lowered to the bottom of the stack. Hidden windows now remain in their original layer so the stacking position remains valid, but all hidden windows get XRestacked under the guard window. A new compositor hook is also added to inform it when a window becomes hidden/unhidded, this lets us map/unmap the corresponding actor. missing files in preview commit (TODO: rebase -i and squash this later)
This commit is contained in:
parent
cfa45beee1
commit
0058271aaa
@ -80,7 +80,13 @@ struct _MetaCompositor
|
|||||||
MetaMotionDirection direction);
|
MetaMotionDirection direction);
|
||||||
|
|
||||||
void (*sync_stack) (MetaCompositor *compositor,
|
void (*sync_stack) (MetaCompositor *compositor,
|
||||||
|
MetaScreen *screen,
|
||||||
GList *stack);
|
GList *stack);
|
||||||
|
|
||||||
|
void (*set_window_hidden) (MetaCompositor *compositor,
|
||||||
|
MetaScreen *screen,
|
||||||
|
MetaWindow *window,
|
||||||
|
gboolean hidden);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -244,11 +244,24 @@ meta_compositor_switch_workspace (MetaCompositor *compositor,
|
|||||||
|
|
||||||
void
|
void
|
||||||
meta_compositor_sync_stack (MetaCompositor *compositor,
|
meta_compositor_sync_stack (MetaCompositor *compositor,
|
||||||
|
MetaScreen *screen,
|
||||||
GList *stack)
|
GList *stack)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
if (compositor && compositor->sync_stack)
|
if (compositor && compositor->sync_stack)
|
||||||
compositor->sync_stack (compositor, stack);
|
compositor->sync_stack (compositor, screen, stack);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_compositor_set_window_hidden (MetaCompositor *compositor,
|
||||||
|
MetaScreen *screen,
|
||||||
|
MetaWindow *window,
|
||||||
|
gboolean hidden)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
|
if (compositor && compositor->set_window_hidden)
|
||||||
|
compositor->set_window_hidden (compositor, screen, window, hidden);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -783,7 +783,7 @@ mutter_window_get_workspace (MutterWindow *mcw)
|
|||||||
return meta_workspace_index (workspace);
|
return meta_workspace_index (workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
mutter_window_showing_on_its_workspace (MutterWindow *mcw)
|
mutter_window_showing_on_its_workspace (MutterWindow *mcw)
|
||||||
{
|
{
|
||||||
if (!mcw)
|
if (!mcw)
|
||||||
@ -796,7 +796,7 @@ mutter_window_showing_on_its_workspace (MutterWindow *mcw)
|
|||||||
return meta_window_showing_on_its_workspace (mcw->priv->window);
|
return meta_window_showing_on_its_workspace (mcw->priv->window);
|
||||||
}
|
}
|
||||||
|
|
||||||
tatic void repair_win (MutterWindow *cw);
|
static void repair_win (MutterWindow *cw);
|
||||||
static void map_win (MutterWindow *cw);
|
static void map_win (MutterWindow *cw);
|
||||||
static void unmap_win (MutterWindow *cw);
|
static void unmap_win (MutterWindow *cw);
|
||||||
|
|
||||||
@ -835,6 +835,7 @@ mutter_finish_workspace_switch (MetaCompScreen *info)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
/*
|
/*
|
||||||
* Fix up stacking order in case the plugin messed it up.
|
* Fix up stacking order in case the plugin messed it up.
|
||||||
*/
|
*/
|
||||||
@ -874,6 +875,7 @@ mutter_finish_workspace_switch (MetaCompScreen *info)
|
|||||||
|
|
||||||
l = l->prev;
|
l = l->prev;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* printf ("... FINISHED DESKTOP SWITCH\n"); */
|
/* printf ("... FINISHED DESKTOP SWITCH\n"); */
|
||||||
|
|
||||||
@ -1223,6 +1225,21 @@ add_win (MetaScreen *screen, MetaWindow *window, Window xwindow)
|
|||||||
XWindowAttributes attrs;
|
XWindowAttributes attrs;
|
||||||
gulong events_needed;
|
gulong events_needed;
|
||||||
|
|
||||||
|
/* Note: this blacklist internal windows is copied from screen.c
|
||||||
|
* Ideally add_win shouldn't be driven by CreateNotify events and
|
||||||
|
* should instead be an event directly from metacity core. */
|
||||||
|
if (xwindow == screen->no_focus_window ||
|
||||||
|
xwindow == screen->flash_window ||
|
||||||
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
|
xwindow == screen->wm_cm_selection_window ||
|
||||||
|
xwindow == screen->guard_window ||
|
||||||
|
#endif
|
||||||
|
xwindow == screen->wm_sn_selection_window) {
|
||||||
|
meta_verbose ("Not managing our own windows\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_printerr ("window =%p\n", window);
|
||||||
if (info == NULL)
|
if (info == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1932,6 +1949,8 @@ clutter_cmp_manage_screen (MetaCompositor *compositor,
|
|||||||
KeyPressMask | KeyReleaseMask);
|
KeyPressMask | KeyReleaseMask);
|
||||||
|
|
||||||
info->window_group = clutter_group_new ();
|
info->window_group = clutter_group_new ();
|
||||||
|
g_object_set_property (G_OBJECT (info->window_group),
|
||||||
|
"show-on-set-parent", FALSE);
|
||||||
info->overlay_group = clutter_group_new ();
|
info->overlay_group = clutter_group_new ();
|
||||||
|
|
||||||
clutter_container_add (CLUTTER_CONTAINER (info->stage),
|
clutter_container_add (CLUTTER_CONTAINER (info->stage),
|
||||||
@ -2288,6 +2307,8 @@ clutter_cmp_switch_workspace (MetaCompositor *compositor,
|
|||||||
|
|
||||||
if (!meta_prefs_get_live_hidden_windows ())
|
if (!meta_prefs_get_live_hidden_windows ())
|
||||||
{
|
{
|
||||||
|
GList *l;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We are in the traditional mode where hidden windows get unmapped,
|
* We are in the traditional mode where hidden windows get unmapped,
|
||||||
* we need to pre-calculate the map status of each window so that once
|
* we need to pre-calculate the map status of each window so that once
|
||||||
@ -2295,9 +2316,7 @@ clutter_cmp_switch_workspace (MetaCompositor *compositor,
|
|||||||
* (we need to ignore the map notifications during the effect so that
|
* (we need to ignore the map notifications during the effect so that
|
||||||
* actors do not just disappear while the effect is running).
|
* actors do not just disappear while the effect is running).
|
||||||
*/
|
*/
|
||||||
GList *l = info->windows;
|
for (l = info->windows; l != NULL; l = l->next)
|
||||||
|
|
||||||
while (l)
|
|
||||||
{
|
{
|
||||||
MutterWindow *cw = l->data;
|
MutterWindow *cw = l->data;
|
||||||
MetaWindow *mw = cw->priv->window;
|
MetaWindow *mw = cw->priv->window;
|
||||||
@ -2327,8 +2346,6 @@ clutter_cmp_switch_workspace (MetaCompositor *compositor,
|
|||||||
cw->priv->needs_unmap = FALSE;
|
cw->priv->needs_unmap = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
l = l->next;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2355,14 +2372,23 @@ clutter_cmp_switch_workspace (MetaCompositor *compositor,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_cmp_sync_stack (MetaCompositor *compositor,
|
clutter_cmp_sync_stack (MetaCompositor *compositor,
|
||||||
|
MetaScreen *screen,
|
||||||
GList *stack)
|
GList *stack)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
|
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||||
|
|
||||||
|
g_printerr ("----------------------------------------\n");
|
||||||
for (tmp = stack; tmp != NULL; tmp = tmp->next)
|
for (tmp = stack; tmp != NULL; tmp = tmp->next)
|
||||||
{
|
{
|
||||||
MetaWindow *window = tmp->data;
|
MetaWindow *window = tmp->data;
|
||||||
MutterWindow *cw = window->compositor_private;
|
MutterWindow *cw = window->compositor_private;
|
||||||
|
GList *link;
|
||||||
|
|
||||||
|
/* FIXME -debug */
|
||||||
|
g_printerr ("sync DEBUG window = %p stack_position=%d\n",
|
||||||
|
window, window->stack_position);
|
||||||
|
|
||||||
if (!cw)
|
if (!cw)
|
||||||
{
|
{
|
||||||
meta_verbose ("Failed to find corresponding MutterWindow "
|
meta_verbose ("Failed to find corresponding MutterWindow "
|
||||||
@ -2371,15 +2397,55 @@ clutter_cmp_sync_stack (MetaCompositor *compositor,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* FIXME: There should be a seperate composite manager hook
|
/* This is a failsafe, it shouldn't be needed if everything is
|
||||||
* for hiding/unhiding the actor when the window becomes
|
* well behaved, but if some plugin accidentally shows a
|
||||||
* hidden or not */
|
* hidden window, this may help. */
|
||||||
if (meta_window_is_hidden (window))
|
if (window->hidden)
|
||||||
clutter_actor_hide (CLUTTER_ACTOR (cw));
|
clutter_actor_hide (CLUTTER_ACTOR (cw));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
clutter_actor_lower_bottom (CLUTTER_ACTOR (cw));
|
clutter_actor_lower_bottom (CLUTTER_ACTOR (cw));
|
||||||
|
|
||||||
|
/* Also maintain the order of info->windows */
|
||||||
|
info->windows = g_list_remove (info->windows, (gconstpointer)cw);
|
||||||
|
info->windows = g_list_prepend (info->windows, cw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* FIXME debug */
|
||||||
|
{
|
||||||
|
g_printerr ("----------------------------------------\n");
|
||||||
|
MetaWindow *window = stack->data;
|
||||||
|
MutterWindow *cw = window->compositor_private;
|
||||||
|
ClutterActor *parent = clutter_actor_get_parent (cw);
|
||||||
|
for (tmp = clutter_container_get_children (parent);
|
||||||
|
tmp != NULL;
|
||||||
|
tmp = tmp->next)
|
||||||
|
{
|
||||||
|
g_printerr ("sync DEBUG: %p\n", tmp->data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clutter_cmp_set_window_hidden (MetaCompositor *compositor,
|
||||||
|
MetaScreen *screen,
|
||||||
|
MetaWindow *window,
|
||||||
|
gboolean hidden)
|
||||||
|
{
|
||||||
|
MutterWindow *cw = window->compositor_private;
|
||||||
|
|
||||||
|
g_return_if_fail (cw);
|
||||||
|
|
||||||
|
if (hidden)
|
||||||
|
{
|
||||||
|
/* FIXME: There needs to be a way to queue this if there is an effect
|
||||||
|
* in progress for this window */
|
||||||
|
clutter_actor_hide (CLUTTER_ACTOR (cw));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
clutter_actor_show (CLUTTER_ACTOR (cw));
|
||||||
}
|
}
|
||||||
|
|
||||||
static MetaCompositor comp_info = {
|
static MetaCompositor comp_info = {
|
||||||
@ -2398,7 +2464,8 @@ static MetaCompositor comp_info = {
|
|||||||
clutter_cmp_unmaximize_window,
|
clutter_cmp_unmaximize_window,
|
||||||
clutter_cmp_update_workspace_geometry,
|
clutter_cmp_update_workspace_geometry,
|
||||||
clutter_cmp_switch_workspace,
|
clutter_cmp_switch_workspace,
|
||||||
clutter_cmp_sync_stack
|
clutter_cmp_sync_stack,
|
||||||
|
clutter_cmp_set_window_hidden
|
||||||
};
|
};
|
||||||
|
|
||||||
MetaCompositor *
|
MetaCompositor *
|
||||||
|
@ -132,6 +132,11 @@ struct _MetaScreen
|
|||||||
|
|
||||||
/* Managed by compositor.c */
|
/* Managed by compositor.c */
|
||||||
gpointer compositor_data;
|
gpointer compositor_data;
|
||||||
|
|
||||||
|
/* Instead of unmapping withdrawn windows we can leave them mapped
|
||||||
|
* and restack them below a guard window. When using a compositor
|
||||||
|
* this allows us to provide live previews of unmapped windows */
|
||||||
|
Window guard_window;
|
||||||
};
|
};
|
||||||
|
|
||||||
MetaScreen* meta_screen_new (MetaDisplay *display,
|
MetaScreen* meta_screen_new (MetaDisplay *display,
|
||||||
|
@ -311,6 +311,38 @@ reload_xinerama_infos (MetaScreen *screen)
|
|||||||
g_assert (screen->xinerama_infos != NULL);
|
g_assert (screen->xinerama_infos != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The guard window allows us to leave minimized windows mapped so
|
||||||
|
* that compositor code may provide live previews of them.
|
||||||
|
* Instead of being unmapped/withdrawn, they get pushed underneath
|
||||||
|
* the guard window. */
|
||||||
|
static Window
|
||||||
|
create_guard_window (Display *xdisplay, MetaScreen *screen)
|
||||||
|
{
|
||||||
|
XSetWindowAttributes attributes;
|
||||||
|
Window guard_window;
|
||||||
|
|
||||||
|
attributes.event_mask = NoEventMask;
|
||||||
|
attributes.override_redirect = True;
|
||||||
|
attributes.background_pixel = BlackPixel (xdisplay, screen->number);
|
||||||
|
|
||||||
|
guard_window =
|
||||||
|
XCreateWindow (xdisplay,
|
||||||
|
screen->xroot,
|
||||||
|
0, /* x */
|
||||||
|
0, /* y */
|
||||||
|
screen->rect.width,
|
||||||
|
screen->rect.height,
|
||||||
|
0, /* border width */
|
||||||
|
CopyFromParent, /* depth */
|
||||||
|
CopyFromParent, /* class */
|
||||||
|
CopyFromParent, /* visual */
|
||||||
|
CWEventMask|CWOverrideRedirect|CWBackPixel,
|
||||||
|
&attributes);
|
||||||
|
XLowerWindow (xdisplay, guard_window);
|
||||||
|
XMapWindow (xdisplay, guard_window);
|
||||||
|
return guard_window;
|
||||||
|
}
|
||||||
|
|
||||||
MetaScreen*
|
MetaScreen*
|
||||||
meta_screen_new (MetaDisplay *display,
|
meta_screen_new (MetaDisplay *display,
|
||||||
int number,
|
int number,
|
||||||
@ -491,6 +523,8 @@ meta_screen_new (MetaDisplay *display,
|
|||||||
screen->starting_corner = META_SCREEN_TOPLEFT;
|
screen->starting_corner = META_SCREEN_TOPLEFT;
|
||||||
screen->compositor_data = NULL;
|
screen->compositor_data = NULL;
|
||||||
|
|
||||||
|
screen->guard_window = create_guard_window (xdisplay, screen);
|
||||||
|
|
||||||
{
|
{
|
||||||
XFontStruct *font_info;
|
XFontStruct *font_info;
|
||||||
XGCValues gc_values;
|
XGCValues gc_values;
|
||||||
@ -760,6 +794,7 @@ meta_screen_manage_all_windows (MetaScreen *screen)
|
|||||||
info->xwindow == screen->flash_window ||
|
info->xwindow == screen->flash_window ||
|
||||||
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
info->xwindow == screen->wm_cm_selection_window ||
|
info->xwindow == screen->wm_cm_selection_window ||
|
||||||
|
info->xwindow == screen->guard_window ||
|
||||||
#endif
|
#endif
|
||||||
info->xwindow == screen->wm_sn_selection_window) {
|
info->xwindow == screen->wm_sn_selection_window) {
|
||||||
meta_verbose ("Not managing our own windows\n");
|
meta_verbose ("Not managing our own windows\n");
|
||||||
|
@ -35,6 +35,10 @@
|
|||||||
#include "prefs.h"
|
#include "prefs.h"
|
||||||
#include "workspace.h"
|
#include "workspace.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||||
|
#include "compositor.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
|
|
||||||
#define WINDOW_HAS_TRANSIENT_TYPE(w) \
|
#define WINDOW_HAS_TRANSIENT_TYPE(w) \
|
||||||
@ -1057,6 +1061,7 @@ stack_sync_to_server (MetaStack *stack)
|
|||||||
GArray *stacked;
|
GArray *stacked;
|
||||||
GArray *root_children_stacked;
|
GArray *root_children_stacked;
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
|
GArray *all_hidden;
|
||||||
|
|
||||||
/* Bail out if frozen */
|
/* Bail out if frozen */
|
||||||
if (stack->freeze_count > 0)
|
if (stack->freeze_count > 0)
|
||||||
@ -1067,6 +1072,7 @@ stack_sync_to_server (MetaStack *stack)
|
|||||||
stack_ensure_sorted (stack);
|
stack_ensure_sorted (stack);
|
||||||
|
|
||||||
meta_compositor_sync_stack (stack->screen->display->compositor,
|
meta_compositor_sync_stack (stack->screen->display->compositor,
|
||||||
|
stack->screen,
|
||||||
stack->sorted);
|
stack->sorted);
|
||||||
|
|
||||||
/* Create stacked xwindow arrays.
|
/* Create stacked xwindow arrays.
|
||||||
@ -1076,29 +1082,42 @@ stack_sync_to_server (MetaStack *stack)
|
|||||||
*/
|
*/
|
||||||
stacked = g_array_new (FALSE, FALSE, sizeof (Window));
|
stacked = g_array_new (FALSE, FALSE, sizeof (Window));
|
||||||
root_children_stacked = g_array_new (FALSE, FALSE, sizeof (Window));
|
root_children_stacked = g_array_new (FALSE, FALSE, sizeof (Window));
|
||||||
|
all_hidden = g_array_new (FALSE, FALSE, sizeof (Window));
|
||||||
|
|
||||||
|
/* The screen guard window sits above all hidden windows and acts as
|
||||||
|
* a barrier to input reaching these windows. */
|
||||||
|
g_array_append_val (all_hidden, stack->screen->guard_window);
|
||||||
|
|
||||||
meta_topic (META_DEBUG_STACK, "Top to bottom: ");
|
meta_topic (META_DEBUG_STACK, "Top to bottom: ");
|
||||||
meta_push_no_msg_prefix ();
|
meta_push_no_msg_prefix ();
|
||||||
|
|
||||||
tmp = stack->sorted;
|
for (tmp = stack->sorted; tmp != NULL; tmp = tmp->next)
|
||||||
while (tmp != NULL)
|
|
||||||
{
|
{
|
||||||
MetaWindow *w;
|
MetaWindow *w = tmp->data;
|
||||||
|
Window top_level_window;
|
||||||
|
|
||||||
w = tmp->data;
|
meta_topic (META_DEBUG_STACK, "%u:%d - %s ",
|
||||||
|
w->layer, w->stack_position, w->desc);
|
||||||
|
|
||||||
/* remember, stacked is in reverse order (bottom to top) */
|
/* remember, stacked is in reverse order (bottom to top) */
|
||||||
g_array_prepend_val (stacked, w->xwindow);
|
g_array_prepend_val (stacked, w->xwindow);
|
||||||
|
|
||||||
/* build XRestackWindows() array from top to bottom */
|
|
||||||
if (w->frame)
|
if (w->frame)
|
||||||
g_array_append_val (root_children_stacked, w->frame->xwindow);
|
top_level_window = w->frame->xwindow;
|
||||||
else
|
else
|
||||||
g_array_append_val (root_children_stacked, w->xwindow);
|
top_level_window = w->xwindow;
|
||||||
|
|
||||||
meta_topic (META_DEBUG_STACK, "%u:%d - %s ", w->layer, w->stack_position, w->desc);
|
/* We don't restack hidden windows along with the rest, though they are
|
||||||
|
* reflected in the _NET hints. Hidden windows all get pushed below
|
||||||
|
* the screens fullscreen guard_window. */
|
||||||
|
if (w->hidden)
|
||||||
|
{
|
||||||
|
g_array_append_val (all_hidden, top_level_window);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
tmp = tmp->next;
|
/* build XRestackWindows() array from top to bottom */
|
||||||
|
g_array_append_val (root_children_stacked, top_level_window);
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_topic (META_DEBUG_STACK, "\n");
|
meta_topic (META_DEBUG_STACK, "\n");
|
||||||
@ -1216,6 +1235,13 @@ stack_sync_to_server (MetaStack *stack)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Push hidden windows to the bottom of the stack under the guard window */
|
||||||
|
XLowerWindow (stack->screen->display->xdisplay, stack->screen->guard_window);
|
||||||
|
XRestackWindows (stack->screen->display->xdisplay,
|
||||||
|
(Window *)all_hidden->data,
|
||||||
|
all_hidden->len);
|
||||||
|
g_array_free (all_hidden, TRUE);
|
||||||
|
|
||||||
meta_error_trap_pop (stack->screen->display, FALSE);
|
meta_error_trap_pop (stack->screen->display, FALSE);
|
||||||
/* on error, a window was destroyed; it should eventually
|
/* on error, a window was destroyed; it should eventually
|
||||||
* get removed from the stacking list when we unmanage it
|
* get removed from the stacking list when we unmanage it
|
||||||
|
@ -428,9 +428,6 @@ void meta_window_resize_with_gravity (MetaWindow *window,
|
|||||||
int gravity);
|
int gravity);
|
||||||
|
|
||||||
|
|
||||||
/* Return whether the window would be showing if we were on its workspace */
|
|
||||||
gboolean meta_window_showing_on_its_workspace (MetaWindow *window);
|
|
||||||
|
|
||||||
/* Return whether the window should be currently mapped */
|
/* Return whether the window should be currently mapped */
|
||||||
gboolean meta_window_should_be_showing (MetaWindow *window);
|
gboolean meta_window_should_be_showing (MetaWindow *window);
|
||||||
|
|
||||||
|
@ -2250,13 +2250,16 @@ meta_window_show (MetaWindow *window)
|
|||||||
}
|
}
|
||||||
else if (meta_prefs_get_live_hidden_windows ())
|
else if (meta_prefs_get_live_hidden_windows ())
|
||||||
{
|
{
|
||||||
if (window->hidden && window->type != META_WINDOW_DESKTOP)
|
if (window->hidden)
|
||||||
{
|
{
|
||||||
window->hidden = FALSE;
|
|
||||||
meta_stack_freeze (window->screen->stack);
|
meta_stack_freeze (window->screen->stack);
|
||||||
meta_window_update_layer (window);
|
window->hidden = FALSE;
|
||||||
meta_window_raise (window);
|
|
||||||
meta_stack_thaw (window->screen->stack);
|
meta_stack_thaw (window->screen->stack);
|
||||||
|
/* Inform the compositor that the window isn't hidden */
|
||||||
|
meta_compositor_set_window_hidden (window->display->compositor,
|
||||||
|
window->screen,
|
||||||
|
window,
|
||||||
|
window->hidden);
|
||||||
did_show = TRUE;
|
did_show = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2333,23 +2336,22 @@ meta_window_hide (MetaWindow *window)
|
|||||||
|
|
||||||
if (meta_prefs_get_live_hidden_windows ())
|
if (meta_prefs_get_live_hidden_windows ())
|
||||||
{
|
{
|
||||||
gboolean was_mapped;
|
|
||||||
|
|
||||||
if (window->hidden)
|
if (window->hidden)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
was_mapped = window->mapped;
|
if (!window->mapped)
|
||||||
|
|
||||||
if (!was_mapped)
|
|
||||||
meta_window_show (window);
|
meta_window_show (window);
|
||||||
|
|
||||||
window->hidden = TRUE;
|
|
||||||
did_hide = TRUE;
|
|
||||||
|
|
||||||
meta_stack_freeze (window->screen->stack);
|
meta_stack_freeze (window->screen->stack);
|
||||||
meta_window_update_layer (window);
|
window->hidden = TRUE;
|
||||||
meta_window_lower (window);
|
|
||||||
meta_stack_thaw (window->screen->stack);
|
meta_stack_thaw (window->screen->stack);
|
||||||
|
/* Tell the compositor this window is now hidden */
|
||||||
|
meta_compositor_set_window_hidden (window->display->compositor,
|
||||||
|
window->screen,
|
||||||
|
window,
|
||||||
|
window->hidden);
|
||||||
|
|
||||||
|
did_hide = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -8013,7 +8015,7 @@ meta_window_update_layer (MetaWindow *window)
|
|||||||
|
|
||||||
meta_stack_freeze (window->screen->stack);
|
meta_stack_freeze (window->screen->stack);
|
||||||
group = meta_window_get_group (window);
|
group = meta_window_get_group (window);
|
||||||
if (!window->hidden && group)
|
if (group)
|
||||||
meta_group_update_layers (group);
|
meta_group_update_layers (group);
|
||||||
else
|
else
|
||||||
meta_stack_update_layer (window->screen->stack, window);
|
meta_stack_update_layer (window->screen->stack, window);
|
||||||
|
@ -130,6 +130,7 @@ meta_compositor_switch_workspace (MetaCompositor *compositor,
|
|||||||
|
|
||||||
void
|
void
|
||||||
meta_compositor_sync_stack (MetaCompositor *compositor,
|
meta_compositor_sync_stack (MetaCompositor *compositor,
|
||||||
|
MetaScreen *screen,
|
||||||
GList *stack);
|
GList *stack);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user