From 6defd9391d16fe99422d12c2ab5475929087c11f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sat, 30 Jul 2016 14:55:45 +0200 Subject: 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 --- src/FocusControl.cc | 7 +++++-- 1 file 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) { BScreen *screen = client ? &client->screen() : 0; if (client && screen && screen->focusControl().isCycling()) { Focusable *next = screen->focusControl().m_cycling_next; - if (next && next != client && screen->focusControl().m_cycling_list->contains(*next)) { + WinClient *nextClient = dynamic_cast(next); + FluxboxWindow *nextWindow = nextClient ? 0 : dynamic_cast(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 // on FocusIn events to provide client-side modality - don't let him next->focus(); - if (WinClient *nextClient = dynamic_cast(next)) + if (nextClient) setFocusedWindow(nextClient); // doesn't happen automatically while cycling, 1148 return; } -- cgit v0.11.2