aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2016-07-30 12:55:45 (GMT)
committerThomas Lübking <thomas.luebking@gmail.com>2016-07-30 13:10:21 (GMT)
commit6defd9391d16fe99422d12c2ab5475929087c11f (patch)
tree51e7b376abf7529d7939d3c3dbfd14871ad82d40
parentf6132b7602263672a97b89a30c6f9efe0355b7ee (diff)
downloadfluxbox-6defd9391d16fe99422d12c2ab5475929087c11f.zip
fluxbox-6defd9391d16fe99422d12c2ab5475929087c11f.tar.bz2
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
-rw-r--r--src/FocusControl.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/FocusControl.cc b/src/FocusControl.cc
index 366af34..54c3d46 100644
--- a/src/FocusControl.cc
+++ b/src/FocusControl.cc
@@ -591,11 +591,14 @@ void FocusControl::setFocusedWindow(WinClient *client) {
591 BScreen *screen = client ? &client->screen() : 0; 591 BScreen *screen = client ? &client->screen() : 0;
592 if (client && screen && screen->focusControl().isCycling()) { 592 if (client && screen && screen->focusControl().isCycling()) {
593 Focusable *next = screen->focusControl().m_cycling_next; 593 Focusable *next = screen->focusControl().m_cycling_next;
594 if (next && next != client && screen->focusControl().m_cycling_list->contains(*next)) { 594 WinClient *nextClient = dynamic_cast<WinClient*>(next);
595 FluxboxWindow *nextWindow = nextClient ? 0 : dynamic_cast<FluxboxWindow*>(next);
596 if (next && nextClient != client && nextWindow != client->fbwindow() &&
597 screen->focusControl().m_cycling_list->contains(*next)) {
595 // if we're currently cycling and the client tries to juggle around focus 598 // if we're currently cycling and the client tries to juggle around focus
596 // on FocusIn events to provide client-side modality - don't let him 599 // on FocusIn events to provide client-side modality - don't let him
597 next->focus(); 600 next->focus();
598 if (WinClient *nextClient = dynamic_cast<WinClient*>(next)) 601 if (nextClient)
599 setFocusedWindow(nextClient); // doesn't happen automatically while cycling, 1148 602 setFocusedWindow(nextClient); // doesn't happen automatically while cycling, 1148
600 return; 603 return;
601 } 604 }