From 70645a691a47dfed61668e7ce5f27136c2c75a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Mon, 10 Nov 2003 18:08:59 +0000 Subject: [PATCH] When a new window appears in a group, make sure group transients are transient for it. svn path=/trunk/kdebase/kwin/; revision=266151 --- group.cpp | 17 ++++++++++++++++- workspace.cpp | 10 +++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/group.cpp b/group.cpp index b7cefd9f8c..6f3c819fce 100644 --- a/group.cpp +++ b/group.cpp @@ -436,7 +436,7 @@ void Client::cleanGrouping() } // Make sure that no group transient is considered transient -// for a window trat is (directly or indirectly) for it. +// for a window trat is (directly or indirectly) transient for it. // Group transients not being transient for each other is already // handled before calling addTransient(). void Client::checkGroupTransients() @@ -634,6 +634,7 @@ Client* Client::findModal() // but it should be used only to find the group, not for anything else void Client::checkGroup() { + bool check_group_transients = false; if( window_group != None ) { Group* new_group = workspace()->findGroup( window_group ); @@ -650,6 +651,7 @@ void Client::checkGroup() in_group->removeMember( this ); in_group = new_group; in_group->addMember( this ); + check_group_transients = true; } } else @@ -664,6 +666,7 @@ void Client::checkGroup() in_group->removeMember( this ); in_group = transientFor()->group(); in_group->addMember( this ); + check_group_transients = true; } } else // not transient without a group, put it in its own group @@ -681,6 +684,18 @@ void Client::checkGroup() } } } + if( check_group_transients ) + { + for( ClientList::ConstIterator it = group()->members().begin(); + it != group()->members().end(); + ++it ) + { + if( !(*it)->groupTransient()) + continue; + if( !transients_list.contains( *it )) + addTransient( *it ); + } + } } diff --git a/workspace.cpp b/workspace.cpp index 84406b1569..8f0da44e5f 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -513,10 +513,10 @@ void Workspace::updateCurrentTopMenu() it != menu_client->transients().end(); ++it ) if( (*it)->isTopMenu()) - { - menubar = *it; - break; - } + { + menubar = *it; + break; + } if( menubar != NULL || !menu_client->isTransient()) break; if( menu_client->isModal() || menu_client->transientFor() == NULL ) @@ -547,7 +547,7 @@ void Workspace::updateCurrentTopMenu() } } -// kdDebug() << "CURRENT TOPMENU:" << menubar << endl; +// kdDebug() << "CURRENT TOPMENU:" << menubar << ":" << active_client << endl; if ( menubar ) menubar->hideClient( false );