aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/FocusControl.cc14
-rw-r--r--src/Screen.cc10
-rw-r--r--src/Window.cc10
3 files changed, 11 insertions, 23 deletions
diff --git a/src/FocusControl.cc b/src/FocusControl.cc
index f0d1387..339541c 100644
--- a/src/FocusControl.cc
+++ b/src/FocusControl.cc
@@ -458,18 +458,8 @@ void FocusControl::setFocusedWindow(WinClient *client) {
458#endif // DEBUG 458#endif // DEBUG
459 459
460 // Update the old focused client to non focus 460 // Update the old focused client to non focus
461 // check if s_focused_window is valid 461 if (s_focused_fbwindow)
462 if (s_focused_window != 0 && 462 s_focused_fbwindow->setFocusFlag(false);
463 Fluxbox::instance()->validateClient(s_focused_window)) {
464
465 if (!client && s_focused_fbwindow)
466 s_focused_fbwindow->setFocusFlag(false);
467
468 } else {
469 s_focused_window = 0;
470 s_focused_fbwindow = 0;
471 }
472
473 463
474 if (client && client->fbwindow() && !client->fbwindow()->isIconic()) { 464 if (client && client->fbwindow() && !client->fbwindow()->isIconic()) {
475 // screen should be ok 465 // screen should be ok
diff --git a/src/Screen.cc b/src/Screen.cc
index 47599bc..df15250 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -1365,11 +1365,10 @@ FluxboxWindow *BScreen::createWindow(Window client) {
1365 1365
1366 // always put on end of focused list, if it gets focused it'll get pushed up 1366 // always put on end of focused list, if it gets focused it'll get pushed up
1367 // there is only the one win client at this stage 1367 // there is only the one win client at this stage
1368 focusControl().addFocusBack(*winclient);
1368 if (focusControl().focusNew()) 1369 if (focusControl().focusNew())
1369 focusControl().addFocusFront(*winclient); 1370 FocusControl::setFocusedWindow(winclient);
1370 else 1371
1371 focusControl().addFocusBack(*winclient);
1372
1373 // we also need to check if another window expects this window to the left 1372 // we also need to check if another window expects this window to the left
1374 // and if so, then join it. 1373 // and if so, then join it.
1375 FluxboxWindow *otherwin = 0; 1374 FluxboxWindow *otherwin = 0;
@@ -1407,6 +1406,9 @@ FluxboxWindow *BScreen::createWindow(WinClient &client) {
1407 return 0; 1406 return 0;
1408 } 1407 }
1409 1408
1409 if (focusControl().focusNew() || FocusControl::focusedWindow() == &client)
1410 FocusControl::setFocusedWindow(&client);
1411
1410 m_clientlist_sig.notify(); 1412 m_clientlist_sig.notify();
1411 1413
1412 return win; 1414 return win;
diff --git a/src/Window.cc b/src/Window.cc
index 80b7ef6..03bde16 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -703,11 +703,9 @@ void FluxboxWindow::attachClient(WinClient &client, int x, int y) {
703 m_workspacesig.notify(); 703 m_workspacesig.notify();
704 m_layersig.notify(); 704 m_layersig.notify();
705 705
706 if (was_focused != 0) { 706 if (was_focused != 0)
707 // already has focus, we're just assuming the state of the old window 707 // already has focus, we're just assuming the state of the old window
708 setCurrentClient(*was_focused, false); 708 FocusControl::setFocusedWindow(&client);
709 frame().setFocus(true);
710 }
711 709
712 frame().reconfigure(); 710 frame().reconfigure();
713 711
@@ -776,10 +774,8 @@ void FluxboxWindow::detachCurrentClient() {
776 return; 774 return;
777 WinClient &client = *m_client; 775 WinClient &client = *m_client;
778 detachClient(*m_client); 776 detachClient(*m_client);
779 if (client.fbwindow() != 0) { 777 if (client.fbwindow() != 0)
780 client.fbwindow()->show(); 778 client.fbwindow()->show();
781 FocusControl::setFocusedWindow(&client);
782 }
783} 779}
784 780
785/// removes client from client list, does not create new fluxboxwindow for it 781/// removes client from client list, does not create new fluxboxwindow for it