aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Window.cc b/src/Window.cc
index a2200f0..68aef8d 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -546,7 +546,7 @@ void FluxboxWindow::init() {
546 iconic = true; 546 iconic = true;
547 deiconify(false); 547 deiconify(false);
548 // check if we should prevent this window from gaining focus 548 // check if we should prevent this window from gaining focus
549 if (!allowsFocusFromClient()) 549 if (!allowsFocusFromClient() || Fluxbox::instance()->isStartup())
550 m_focused = false; 550 m_focused = false;
551 } 551 }
552 552
@@ -650,9 +650,10 @@ void FluxboxWindow::attachClient(WinClient &client, int x, int y) {
650 frame().clientArea().height()); 650 frame().clientArea().height());
651 651
652 // right now, this block only happens with new windows or on restart 652 // right now, this block only happens with new windows or on restart
653 if (screen().focusControl().focusNew() || 653 if (screen().focusControl().focusNew() &&
654 Fluxbox::instance()->isStartup()) 654 !Fluxbox::instance()->isStartup())
655 focused_win = &client; 655 was_focused = true;
656 focused_win = screen().focusControl().focusNew() ? &client : m_client;
656 657
657 client.saveBlackboxAttribs(m_blackbox_attrib); 658 client.saveBlackboxAttribs(m_blackbox_attrib);
658 m_clientlist.push_back(&client); 659 m_clientlist.push_back(&client);
@@ -674,7 +675,7 @@ void FluxboxWindow::attachClient(WinClient &client, int x, int y) {
674 if (!focused_win) 675 if (!focused_win)
675 focused_win = screen().focusControl().lastFocusedWindow(*this); 676 focused_win = screen().focusControl().lastFocusedWindow(*this);
676 if (focused_win) 677 if (focused_win)
677 focused_win->focus(); 678 setCurrentClient(*focused_win, false);
678 } 679 }
679 frame().reconfigure(); 680 frame().reconfigure();
680} 681}
@@ -1553,9 +1554,8 @@ void FluxboxWindow::deiconify(bool reassoc, bool do_raise) {
1553 // focus new, OR if it's the only window on the workspace 1554 // focus new, OR if it's the only window on the workspace
1554 // but not on startup: focus will be handled after creating everything 1555 // but not on startup: focus will be handled after creating everything
1555 // we use m_focused as a signal to focus the window when mapped 1556 // we use m_focused as a signal to focus the window when mapped
1556 if (was_iconic && !Fluxbox::instance()->isStartup() && 1557 if (was_iconic && (screen().currentWorkspace()->numberOfWindows() == 1 ||
1557 (screen().focusControl().focusNew() || m_client->isTransient() || 1558 screen().focusControl().focusNew() || m_client->isTransient()))
1558 screen().currentWorkspace()->numberOfWindows() == 1))
1559 m_focused = true; 1559 m_focused = true;
1560 1560
1561 oplock = false; 1561 oplock = false;