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 );