handle both Focusable's as m_cycling_next
m_cycling_next can either be WinClient or a FluxboxWindow In case of the latter, client->fbwindow() needs to be matched in setFocusedWindow when protecting against client side focus juggling. BUG: 1148
This commit is contained in:
parent
f6132b7602
commit
6defd9391d
1 changed files with 5 additions and 2 deletions
|
@ -591,11 +591,14 @@ void FocusControl::setFocusedWindow(WinClient *client) {
|
||||||
BScreen *screen = client ? &client->screen() : 0;
|
BScreen *screen = client ? &client->screen() : 0;
|
||||||
if (client && screen && screen->focusControl().isCycling()) {
|
if (client && screen && screen->focusControl().isCycling()) {
|
||||||
Focusable *next = screen->focusControl().m_cycling_next;
|
Focusable *next = screen->focusControl().m_cycling_next;
|
||||||
if (next && next != client && screen->focusControl().m_cycling_list->contains(*next)) {
|
WinClient *nextClient = dynamic_cast<WinClient*>(next);
|
||||||
|
FluxboxWindow *nextWindow = nextClient ? 0 : dynamic_cast<FluxboxWindow*>(next);
|
||||||
|
if (next && nextClient != client && nextWindow != client->fbwindow() &&
|
||||||
|
screen->focusControl().m_cycling_list->contains(*next)) {
|
||||||
// if we're currently cycling and the client tries to juggle around focus
|
// if we're currently cycling and the client tries to juggle around focus
|
||||||
// on FocusIn events to provide client-side modality - don't let him
|
// on FocusIn events to provide client-side modality - don't let him
|
||||||
next->focus();
|
next->focus();
|
||||||
if (WinClient *nextClient = dynamic_cast<WinClient*>(next))
|
if (nextClient)
|
||||||
setFocusedWindow(nextClient); // doesn't happen automatically while cycling, 1148
|
setFocusedWindow(nextClient); // doesn't happen automatically while cycling, 1148
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue