setting focus the right way

This commit is contained in:
markt 2006-07-09 04:45:02 +00:00
parent f7574fe1c9
commit 8a640f8d63
2 changed files with 8 additions and 13 deletions

View file

@ -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();

View file

@ -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;