From 5b5ec479fab47fb0e82a93d1a793a4ca71b8684c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Mon, 28 Apr 2008 14:39:13 +0000 Subject: [PATCH] When deciding where to transfer focus when a window is closed, consider all windows in its group, not just its mainwindows. svn path=/trunk/KDE/kdebase/workspace/; revision=802097 --- activation.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/activation.cpp b/activation.cpp index 34dda93f32..18bb9022e2 100644 --- a/activation.cpp +++ b/activation.cpp @@ -416,16 +416,16 @@ bool Workspace::activateNextClient( Client* c ) if( focusChangeEnabled()) { if ( options->focusPolicyIsReasonable()) - { // search the focus_chain for a client to transfer focus to - // if 'c' is transient, transfer focus to the first suitable mainwindow + { // search the focus_chain for a client to transfer focus to, + // first try to transfer focus to the first suitable window in the group Client* get_focus = NULL; - const ClientList mainwindows = ( c != NULL ? c->mainClients() : ClientList()); + const ClientList windows = ( c != NULL ? c->group()->members() : ClientList()); for ( int i = focus_chain[ currentDesktop() ].size() - 1; i >= 0; --i ) { Client* ci = focus_chain[ currentDesktop() ].at( i ); - if( !ci->isShown( false ) + if( c == ci || !ci->isShown( false ) || !ci->isOnCurrentDesktop()) continue; if( options->separateScreenFocus ) @@ -435,7 +435,7 @@ bool Workspace::activateNextClient( Client* c ) if( c == NULL && !ci->isOnScreen( activeScreen())) continue; } - if( mainwindows.contains( ci )) + if( windows.contains( ci )) { get_focus = ci; break;