aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc60
1 files changed, 22 insertions, 38 deletions
diff --git a/src/Window.cc b/src/Window.cc
index c48a6ff..125347b 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -545,7 +545,7 @@ void FluxboxWindow::init() {
545 iconify(); 545 iconify();
546 } else if (m_workspace_number == screen().currentWorkspaceID()) { 546 } else if (m_workspace_number == screen().currentWorkspaceID()) {
547 iconic = true; 547 iconic = true;
548 deiconify(false); 548 deiconify();
549 // check if we should prevent this window from gaining focus 549 // check if we should prevent this window from gaining focus
550 if (!allowsFocusFromClient() || Fluxbox::instance()->isStartup()) 550 if (!allowsFocusFromClient() || Fluxbox::instance()->isStartup())
551 m_focused = false; 551 m_focused = false;
@@ -1416,57 +1416,41 @@ void FluxboxWindow::iconify() {
1416 // focus revert is done elsewhere (based on signal) 1416 // focus revert is done elsewhere (based on signal)
1417} 1417}
1418 1418
1419void FluxboxWindow::deiconify(bool reassoc, bool do_raise) { 1419void FluxboxWindow::deiconify(bool do_raise) {
1420 if (numClients() == 0) 1420 if (numClients() == 0 || !iconic || oplock)
1421 return; 1421 return;
1422 1422
1423 if (oplock) return;
1424 oplock = true; 1423 oplock = true;
1425 1424
1426 if (iconic && 1425 // reassociate first, so it gets removed from screen's icon list
1427 m_workspace_number != screen().currentWorkspace()->workspaceID()) { 1426 screen().reassociateWindow(this, m_workspace_number, false);
1428 // reassociate first, so it gets removed from screen's icon list
1429 screen().reassociateWindow(this, m_workspace_number, false);
1430 iconic = false;
1431 return;
1432 }
1433
1434 if (iconic || reassoc)
1435 screen().reassociateWindow(this, screen().currentWorkspaceID(), false);
1436 else if (moving || m_workspace_number != screen().currentWorkspaceID()) {
1437 oplock = false;
1438 return;
1439 }
1440
1441 bool was_iconic = iconic;
1442
1443 iconic = false; 1427 iconic = false;
1444 m_statesig.notify(); 1428 m_statesig.notify();
1445 1429
1446 if (reassoc && !m_client->transients.empty()) { 1430 // deiconify all transients
1447 // deiconify all transients 1431 ClientList::iterator client_it = clientList().begin();
1448 ClientList::iterator client_it = clientList().begin(); 1432 ClientList::iterator client_it_end = clientList().end();
1449 ClientList::iterator client_it_end = clientList().end(); 1433 for (; client_it != client_it_end; ++client_it) {
1450 for (; client_it != client_it_end; ++client_it) { 1434 WinClient::TransientList::iterator trans_it =
1451 //TODO: Can this get stuck in a loop? 1435 (*client_it)->transientList().begin();
1452 WinClient::TransientList::iterator trans_it = 1436 WinClient::TransientList::iterator trans_it_end =
1453 (*client_it)->transientList().begin(); 1437 (*client_it)->transientList().end();
1454 WinClient::TransientList::iterator trans_it_end = 1438 for (; trans_it != trans_it_end; ++trans_it) {
1455 (*client_it)->transientList().end(); 1439 if ((*trans_it)->fbwindow())
1456 for (; trans_it != trans_it_end; ++trans_it) { 1440 (*trans_it)->fbwindow()->deiconify(false);
1457 if ((*trans_it)->fbwindow())
1458 (*trans_it)->fbwindow()->deiconify(true, false);
1459 }
1460 } 1441 }
1461 } 1442 }
1462 1443
1444 if (m_workspace_number != screen().currentWorkspaceID())
1445 return;
1446
1463 show(); 1447 show();
1464 1448
1465 // focus new, OR if it's the only window on the workspace 1449 // focus new, OR if it's the only window on the workspace
1466 // but not on startup: focus will be handled after creating everything 1450 // but not on startup: focus will be handled after creating everything
1467 // we use m_focused as a signal to focus the window when mapped 1451 // we use m_focused as a signal to focus the window when mapped
1468 if (was_iconic && (screen().currentWorkspace()->numberOfWindows() == 1 || 1452 if (screen().currentWorkspace()->numberOfWindows() == 1 ||
1469 screen().focusControl().focusNew() || m_client->isTransient())) 1453 screen().focusControl().focusNew() || m_client->isTransient())
1470 m_focused = true; 1454 m_focused = true;
1471 1455
1472 oplock = false; 1456 oplock = false;
@@ -2231,7 +2215,7 @@ void FluxboxWindow::mapRequestEvent(XMapRequestEvent &re) {
2231 return; 2215 return;
2232 2216
2233 setCurrentClient(*client, false); // focus handled on MapNotify 2217 setCurrentClient(*client, false); // focus handled on MapNotify
2234 deiconify(false); 2218 deiconify();
2235 2219
2236} 2220}
2237 2221