From ca3236f76c9fc211a3d8d3a20fcce3fca3bfe166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Sandmann?= Date: Wed, 24 May 2006 18:38:54 +0000 Subject: [PATCH] Add a stack-freeze feature to CWindow. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wed May 24 14:36:42 2006 Søren Sandmann * src/c-window.c (meta_comp_window_{freeze,thaw}_stack: Add a stack-freeze feature to CWindow. * src/c-screen.c (meta_comp_screen_restack): Don't restack if the window is frozen. --- ChangeLog | 8 ++++++++ src/c-screen.c | 14 +++++++++----- src/c-window.c | 23 +++++++++++++++++++++-- src/c-window.h | 5 +++++ src/compositor.c | 1 + 5 files changed, 44 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ec503d1d..378fa1be2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Wed May 24 14:36:42 2006 Søren Sandmann + + * src/c-window.c (meta_comp_window_{freeze,thaw}_stack: Add a + stack-freeze feature to CWindow. + + * src/c-screen.c (meta_comp_screen_restack): Don't restack if the + window is frozen. + Wed May 24 13:09:49 2006 Søren Sandmann * src/c-window.c: Fix compilation in the non-composited case. diff --git a/src/c-screen.c b/src/c-screen.c index 990326478..ab5a9e7df 100644 --- a/src/c-screen.c +++ b/src/c-screen.c @@ -155,7 +155,7 @@ repaint (gpointer data) cm_state_enable_depth_buffer_update (state); g_object_unref (state); - + ws_window_gl_swap_buffers (info->gl_window); glFinish(); @@ -414,12 +414,16 @@ meta_comp_screen_restack (MetaCompScreen *info, Window window, Window above_this) { + MetaCompWindow *comp_window = find_comp_window (info, window); + MetaCompWindow *above_comp_window = find_comp_window (info, above_this); CmNode *window_node = find_node (info, window); CmNode *above_node = find_node (info, above_this); - -#if 0 - g_print ("restack %lx over %lx \n", window, above_this); -#endif + + if ((comp_window && meta_comp_window_stack_frozen (comp_window)) || + (above_comp_window && meta_comp_window_stack_frozen (above_comp_window))) + { + return; + } #if 0 dump_stacking_order (info->stacker->children); diff --git a/src/c-window.c b/src/c-window.c index 7fe8523c0..872ae938e 100644 --- a/src/c-window.c +++ b/src/c-window.c @@ -51,6 +51,8 @@ struct _MetaCompWindow gboolean animation_in_progress; gboolean hide_after_animation; + + int stack_freeze_count; }; static Window @@ -191,7 +193,6 @@ meta_comp_window_hide (MetaCompWindow *comp_window) return; } - g_print ("hide %p\n", comp_window->node); cm_drawable_node_set_viewable (CM_DRAWABLE_NODE (comp_window->node), FALSE); } @@ -528,7 +529,7 @@ meta_comp_window_set_updates (MetaCompWindow *comp_window, CmDrawableNode *node = CM_DRAWABLE_NODE (comp_window->node); comp_window->updates = updates; - + cm_drawable_node_set_updates (node, updates); if (updates) @@ -981,3 +982,21 @@ meta_compositor_minimize (MetaCompositor *compositor, g_idle_add (run_animation_01, info); } #endif + +void +meta_comp_window_freeze_stack (MetaCompWindow *comp_window) +{ + comp_window->stack_freeze_count++; +} + +void +meta_comp_window_thaw_stack (MetaCompWindow *comp_window) +{ + comp_window->stack_freeze_count--; +} + +gboolean +meta_comp_window_stack_frozen (MetaCompWindow *comp_window) +{ + return comp_window->stack_freeze_count > 0; +} diff --git a/src/c-window.h b/src/c-window.h index 627d81d74..aaf234944 100644 --- a/src/c-window.h +++ b/src/c-window.h @@ -45,6 +45,11 @@ void meta_comp_window_shrink (MetaCompWindow *comp_window, MetaEffect *effect); void meta_comp_window_unshrink (MetaCompWindow *comp_window, MetaEffect *effect); +void meta_comp_window_restack (MetaCompWindow *comp_window, + MetaCompWindow *above); +void meta_comp_window_freeze_stack (MetaCompWindow *comp_window); +void meta_comp_window_thaw_stack (MetaCompWindow *comp_window); +gboolean meta_comp_window_stack_frozen (MetaCompWindow *comp_window); #if 0 void meta_comp_window_set_explode (MetaCompWindow *comp_window, diff --git a/src/compositor.c b/src/compositor.c index 46f47b42e..af1b1b512 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -143,6 +143,7 @@ do_effect (MetaEffect *effect, MetaCompWindow *window = meta_comp_screen_lookup_window (screen, effect->u.minimize.window->frame->xwindow); + meta_comp_window_freeze_stack (window); meta_comp_window_set_updates (window, FALSE); meta_comp_window_explode (window, effect); break;