Move compositor-stack handling to MetaStackTracker

In order to properly track the stacking order for override-redirect
windows, move meta_compositor_sync_stack() call into MetaStackTracker.
In the new location, we sync the stack as a before-redraw idle function,
rather then using the freeze-thaw facilities of MetaStack. This is
simpler, and also properly compresses multiple stack changes on
notifications received from the X server.

http://bugzilla.gnome.org/show_bug.cgi?id=585984
This commit is contained in:
Owen W. Taylor
2009-06-14 08:04:28 -04:00
parent a4cd66f599
commit 6314ee8780
5 changed files with 135 additions and 32 deletions

View File

@@ -1001,6 +1001,13 @@ meta_window_new_with_attrs (MetaDisplay *display,
/* Sync stack changes */
meta_stack_thaw (window->screen->stack);
/* Usually the we'll have queued a stack sync anyways, because we've
* added a new frame window or restacked. But if an undecorated
* window is mapped, already stacked in the right place, then we
* might need to do this explicitly.
*/
meta_stack_tracker_queue_sync_stack (window->screen->stack_tracker);
/* disable show desktop mode unless we're a desktop component */
maybe_leave_show_desktop_mode (window);
@@ -1309,6 +1316,12 @@ meta_window_unmanage (MetaWindow *window,
if (window->frame)
meta_window_destroy_frame (window);
/* If an undecorated window is being withdrawn, that will change the
* stack as presented to the compositing manager, without actually
* changing the stacking order of X windows.
*/
meta_stack_tracker_queue_sync_stack (window->screen->stack_tracker);
if (window->withdrawn)
{
/* We need to clean off the window's state so it