diff --git a/layers.cpp b/layers.cpp index 05ed7cb7e3..bf29cad327 100644 --- a/layers.cpp +++ b/layers.cpp @@ -388,10 +388,12 @@ void Workspace::restackClientUnderActive( Client* c ) { if( Client::belongToSameApplication( active_client, *it )) { + unconstrained_stacking_order.remove( c ); unconstrained_stacking_order.insert( it, c ); break; } } + assert( unconstrained_stacking_order.contains( c )); if( c->wantsTabFocus() && focus_chain.contains( active_client )) { // also put in focus_chain after all windows belonging to the active application