diff --git a/client.h b/client.h index 6cbac84611..48f35dd913 100644 --- a/client.h +++ b/client.h @@ -55,6 +55,7 @@ class Client : public QObject, public KDecorationDefines Client* transientFor(); bool isTransient() const; bool groupTransient() const; + bool wasOriginallyGroupTransient() const; ClientList mainClients() const; // call once before loop , is not indirect bool hasTransient( const Client* c, bool indirect ) const; const ClientList& transients() const; // is not indirect @@ -532,6 +533,13 @@ inline bool Client::groupTransient() const return transient_for_id == workspace()->rootWin(); } +// needed because verifyTransientFor() may set transient_for_id to root window, +// if the original value has a problem (window doesn't exist, etc.) +inline bool Client::wasOriginallyGroupTransient() const + { + return original_transient_for_id == workspace()->rootWin(); + } + inline bool Client::isTransient() const { return transient_for_id != None; diff --git a/workspace.cpp b/workspace.cpp index 717783ad05..671f40a8e0 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -507,6 +507,8 @@ void Workspace::removeClient( Client* c, allowed_t ) void Workspace::updateCurrentTopMenu() { + if( !managingTopMenus()) + return; // toplevel menubar handling Client* menubar = 0; bool block_desktop_menubar = false; @@ -558,11 +560,11 @@ void Workspace::updateCurrentTopMenu() for( ClientList::ConstIterator it = topmenus.begin(); it != topmenus.end(); ++it ) - if( (*it)->groupTransient()) - { - menubar = *it; - break; - } + if( (*it)->wasOriginallyGroupTransient()) // kdesktop's topmenu has WM_TRANSIENT_FOR + { // set pointing to the root window + menubar = *it; // to recognize it here + break; // Also, with the xroot hack in kdesktop, + } // there's no NET::Desktop window to be transient for } } @@ -572,27 +574,19 @@ void Workspace::updateCurrentTopMenu() if( active_client && !menubar->isOnDesktop( active_client->desktop())) menubar->setDesktop( active_client->desktop()); menubar->hideClient( false ); + topmenu_space->hide(); + } + else + { // no topmenu active - show the space window, so that there's not empty space + topmenu_space->show(); } // ... then hide the other ones. Avoids flickers. -#if 0 - // Leave the desktop menubars always visible. Helps visually when the app doesn't show - // its menubar immediately. - for ( ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it) - { - if( (*it)->isTopMenu() && (*it) != menubar && !(*it)->mainClient()->isDesktop() ) - (*it)->hideClient( true ); - } -#else - // There's a blank area where topmenus are placed, no need to keep - // the desktop one always visible for ( ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it) { if( (*it)->isTopMenu() && (*it) != menubar ) (*it)->hideClient( true ); } -#endif - }