From 8a640f8d638d1f330f816a2ed00931ba2d01847d Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 9 Jul 2006 04:45:02 +0000 Subject: setting focus the right way --- src/Screen.cc | 4 +--- src/Window.cc | 17 +++++++---------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index d0accfc..c0d0706 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1375,8 +1375,6 @@ FluxboxWindow *BScreen::createWindow(Window client) { // 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 @@ FluxboxWindow *BScreen::createWindow(WinClient &client) { } if (focusControl().focusNew() || FocusControl::focusedWindow() == &client) - FocusControl::setFocusedWindow(&client); + win->setInputFocus(); m_clientlist_sig.notify(); diff --git a/src/Window.cc b/src/Window.cc index 85d1ac6..d9c273a 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -2470,17 +2470,14 @@ void FluxboxWindow::mapNotifyEvent(XMapEvent &ne) { 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; -- cgit v0.11.2