Avoid infinite loop with CDE-style Alt+Tab (#112737).
svn path=/trunk/KDE/kdebase/workspace/; revision=488475
This commit is contained in:
parent
d41b6d71fc
commit
b627b8b43e
1 changed files with 18 additions and 17 deletions
35
tabbox.cpp
35
tabbox.cpp
|
@ -931,28 +931,29 @@ void Workspace::CDEWalkThroughWindows( bool forward )
|
|||
options_traverse_all = group.readNumEntry("TraverseAll", false );
|
||||
}
|
||||
|
||||
if ( !forward )
|
||||
Client* firstClient = 0;
|
||||
do
|
||||
{
|
||||
do
|
||||
nc = forward ? nextStaticClient(nc) : previousStaticClient(nc);
|
||||
if (!firstClient)
|
||||
{
|
||||
nc = previousStaticClient(nc);
|
||||
} while (nc && nc != c &&
|
||||
(( !options_traverse_all && !nc->isOnDesktop(currentDesktop())) ||
|
||||
nc->isMinimized() || !nc->wantsTabFocus() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
do
|
||||
// When we see our first client for the second time,
|
||||
// it's time to stop.
|
||||
firstClient = nc;
|
||||
}
|
||||
else if (nc == firstClient)
|
||||
{
|
||||
nc = nextStaticClient(nc);
|
||||
} while (nc && nc != c &&
|
||||
(( !options_traverse_all && !nc->isOnDesktop(currentDesktop())) ||
|
||||
nc->isMinimized() || !nc->wantsTabFocus() ) );
|
||||
}
|
||||
if (c && c != nc)
|
||||
lowerClient( c );
|
||||
// No candidates found.
|
||||
nc = 0;
|
||||
break;
|
||||
}
|
||||
} while (nc && nc != c &&
|
||||
(( !options_traverse_all && !nc->isOnDesktop(currentDesktop())) ||
|
||||
nc->isMinimized() || !nc->wantsTabFocus() ) );
|
||||
if (nc)
|
||||
{
|
||||
if (c && c != nc)
|
||||
lowerClient( c );
|
||||
if ( options->focusPolicyIsReasonable() )
|
||||
{
|
||||
activateClient( nc );
|
||||
|
|
Loading…
Reference in a new issue