all repos — fluxbox @ 8a640f8d638d1f330f816a2ed00931ba2d01847d

custom fork of the fluxbox windowmanager

setting focus the right way
markt markt
commit

8a640f8d638d1f330f816a2ed00931ba2d01847d

parent

f7574fe1c90118ca7421dffef0b035cb64cf78c1

2 files changed, 8 insertions(+), 13 deletions(-)

jump to
M src/Screen.ccsrc/Screen.cc

@@ -1375,8 +1375,6 @@

// always put on end of focused list, if it gets focused it'll get pushed up // there is only the one win client at this stage focusControl().addFocusBack(*winclient); - if (focusControl().focusNew()) - FocusControl::setFocusedWindow(winclient); // we also need to check if another window expects this window to the left // and if so, then join it.

@@ -1416,7 +1414,7 @@ return 0;

} if (focusControl().focusNew() || FocusControl::focusedWindow() == &client) - FocusControl::setFocusedWindow(&client); + win->setInputFocus(); m_clientlist_sig.notify();
M src/Window.ccsrc/Window.cc

@@ -2470,17 +2470,14 @@ return;

setState(NormalState, false); - if (client->isTransient()) + FluxboxWindow *cur = FocusControl::focusedFbWindow(); + if (client->isTransient() || + m_screen.currentWorkspace()->numberOfWindows() == 1 || + m_screen.focusControl().focusNew() && !(cur && cur->isFullscreen())) setCurrentClient(*client, true); - else if (screen().focusControl().focusNew()) { - FluxboxWindow *cur = FocusControl::focusedFbWindow(); - if (cur && cur->isFullscreen()) { - setFocusFlag(false); - Fluxbox::instance()->attentionHandler().addAttention(*client); - } else - setCurrentClient(*client, true); - } else - setFocusFlag(false); + else if (m_screen.focusControl().focusNew()) + Fluxbox::instance()->attentionHandler().addAttention(*client); + iconic = false;