From 79bb84e119b73fdbf01830e7a5de2efc6dda53f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Fri, 4 Jul 2008 14:06:23 +0000 Subject: [PATCH] Use KWin's internal stacking order for managed windows, not the X one. Fixes composited drawing of windows on other desktops. BUG: 161436 svn path=/trunk/KDE/kdebase/workspace/; revision=828060 --- composite.cpp | 2 +- layers.cpp | 9 +++++---- workspace.h | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/composite.cpp b/composite.cpp index b1e37b1f85..e81a359cd2 100644 --- a/composite.cpp +++ b/composite.cpp @@ -316,7 +316,7 @@ void Workspace::performCompositing() return; } // create a list of all windows in the stacking order - ToplevelList windows = rootStackingOrder(); + ToplevelList windows = compositingStackingOrder(); foreach( EffectWindow* c, static_cast< EffectsHandlerImpl* >( effects )->elevatedWindows()) { Toplevel* t = static_cast< EffectWindowImpl* >( c )->window(); diff --git a/layers.cpp b/layers.cpp index b676ba36ac..adf5aa6407 100644 --- a/layers.cpp +++ b/layers.cpp @@ -722,20 +722,21 @@ bool Workspace::keepTransientAbove( const Client* mainwindow, const Client* tran // Returns all windows in their stacking order on the root window, used only by compositing. // TODO This possibly should be optimized to avoid the X roundtrip and building it every pass. -ToplevelList Workspace::rootStackingOrder() const +ToplevelList Workspace::compositingStackingOrder() const { Window dummy; Window* windows = NULL; unsigned int count = 0; XQueryTree( display(), rootWindow(), &dummy, &dummy, &windows, &count ); ToplevelList ret; + // use our own stacking order, not the X one, as they may differ + foreach( Client* c, stacking_order ) + ret.append( c ); for( unsigned int i = 0; i < count; ++i ) { - if( Client* c = findClient( FrameIdMatchPredicate( windows[ i ] ))) - ret.append( c ); - else if( Unmanaged* c = findUnmanaged( WindowMatchPredicate( windows[ i ] ))) + if( Unmanaged* c = findUnmanaged( WindowMatchPredicate( windows[ i ] ))) ret.append( c ); } foreach( Deleted* c, deleted ) diff --git a/workspace.h b/workspace.h index f36b449492..c289677c6f 100644 --- a/workspace.h +++ b/workspace.h @@ -514,7 +514,7 @@ class Workspace : public QObject, public KDecorationDefines void removeTabBoxGrab(); void updateStackingOrder( bool propagate_new_clients = false ); - ToplevelList rootStackingOrder() const; + ToplevelList compositingStackingOrder() const; void propagateClients( bool propagate_new_clients ); // called only from updateStackingOrder ClientList constrainedStackingOrder(); void raiseClientWithinApplication( Client* c );