From 83657d963d7d509ff0b10a895e29630a8bf54a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Tue, 8 Jun 2004 14:04:29 +0000 Subject: [PATCH] Hide utility windows for inactive applications even right after being shown. Don't hide utility windows that are standalone or for special windows. svn path=/trunk/kdebase/kwin/; revision=318750 --- workspace.cpp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/workspace.cpp b/workspace.cpp index 546d22164e..2dd47e145d 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -460,6 +460,8 @@ void Workspace::addClient( Client* c, allowed_t ) } if( !unconstrained_stacking_order.contains( c )) unconstrained_stacking_order.append( c ); + if( !stacking_order.contains( c )) // it'll be updated later, and updateToolWindows() requires + stacking_order.append( c ); // c to be in stacking_order if( c->isTopMenu()) addTopMenu( c ); updateClientArea(); // this cannot be in manage(), because the client got added only now @@ -471,10 +473,10 @@ void Workspace::addClient( Client* c, allowed_t ) if( activeClient() == NULL && should_get_focus.count() == 0 ) activateClient( findDesktop( true, currentDesktop())); } - if( c->isUtility() || c->isMenu() || c->isToolbar()) - updateToolWindows( true ); checkTransients( c->window()); // SELI does this really belong here? updateStackingOrder( true ); // propagate new client + if( c->isUtility() || c->isMenu() || c->isToolbar()) + updateToolWindows( true ); } /* @@ -669,10 +671,25 @@ void Workspace::updateToolWindows( bool also_hide ) else show = false; } + if( !show && also_hide ) + { + const ClientList mainclients = (*it)->mainClients(); + // don't hide utility windows which are standalone(?) or + // have e.g. kicker as mainwindow + if( mainclients.isEmpty()) + show = true; + for( ClientList::ConstIterator it2 = mainclients.begin(); + it2 != mainclients.end(); + ++it2 ) + { + if( (*it2)->isSpecialWindow()) + show = true; + } + if( !show ) + to_hide.append( *it ); + } if( show ) to_show.append( *it ); - else if( also_hide ) - to_hide.append( *it ); } } // first show new ones, then hide for( ClientList::ConstIterator it = to_show.fromLast();