aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/Window.cc b/src/Window.cc
index f91f741..c43ab36 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -260,7 +260,6 @@ FluxboxWindow::FluxboxWindow(WinClient &client):
260 Focusable(client.screen(), this), 260 Focusable(client.screen(), this),
261 oplock(false), 261 oplock(false),
262 m_hintsig(*this), 262 m_hintsig(*this),
263 m_statesig(*this),
264 m_layersig(*this), 263 m_layersig(*this),
265 m_creation_time(0), 264 m_creation_time(0),
266 moving(false), resizing(false), 265 moving(false), resizing(false),
@@ -625,7 +624,7 @@ void FluxboxWindow::attachClient(WinClient &client, int x, int y) {
625 // make sure that the state etc etc is updated for the new client 624 // make sure that the state etc etc is updated for the new client
626 // TODO: one day these should probably be neatened to only act on the 625 // TODO: one day these should probably be neatened to only act on the
627 // affected clients if possible 626 // affected clients if possible
628 m_statesig.notify(); 627 m_statesig.emit(*this);
629 m_workspacesig.emit(*this); 628 m_workspacesig.emit(*this);
630 m_layersig.notify(); 629 m_layersig.notify();
631 630
@@ -1336,7 +1335,7 @@ void FluxboxWindow::iconify() {
1336 return; 1335 return;
1337 1336
1338 m_state.iconic = true; 1337 m_state.iconic = true;
1339 m_statesig.notify(); 1338 m_statesig.emit(*this);
1340 1339
1341 hide(true); 1340 hide(true);
1342 1341
@@ -1365,7 +1364,7 @@ void FluxboxWindow::deiconify(bool do_raise) {
1365 // reassociate first, so it gets removed from screen's icon list 1364 // reassociate first, so it gets removed from screen's icon list
1366 screen().reassociateWindow(this, m_workspace_number, false); 1365 screen().reassociateWindow(this, m_workspace_number, false);
1367 m_state.iconic = false; 1366 m_state.iconic = false;
1368 m_statesig.notify(); 1367 m_statesig.emit(*this);
1369 1368
1370 // deiconify all transients 1369 // deiconify all transients
1371 ClientList::iterator client_it = clientList().begin(); 1370 ClientList::iterator client_it = clientList().begin();
@@ -1418,7 +1417,7 @@ void FluxboxWindow::setFullscreen(bool flag) {
1418 m_state.fullscreen = true; 1417 m_state.fullscreen = true;
1419 frame().applyState(); 1418 frame().applyState();
1420 1419
1421 setFullscreenLayer(); // calls stateSig().notify() 1420 setFullscreenLayer(); // calls stateSig().emit()
1422 if (!isFocused()) { 1421 if (!isFocused()) {
1423 join(screen().focusedWindowSig(), 1422 join(screen().focusedWindowSig(),
1424 FbTk::MemFun(*this, &FluxboxWindow::focusedWindowChanged)); 1423 FbTk::MemFun(*this, &FluxboxWindow::focusedWindowChanged));
@@ -1430,7 +1429,7 @@ void FluxboxWindow::setFullscreen(bool flag) {
1430 frame().applyState(); 1429 frame().applyState();
1431 1430
1432 moveToLayer(m_old_layernum); 1431 moveToLayer(m_old_layernum);
1433 stateSig().notify(); 1432 stateSig().emit(*this);
1434 } 1433 }
1435 1434
1436 attachWorkAreaSig(); 1435 attachWorkAreaSig();
@@ -1448,7 +1447,7 @@ void FluxboxWindow::setFullscreenLayer() {
1448 } else { 1447 } else {
1449 moveToLayer(::ResourceLayer::DESKTOP); 1448 moveToLayer(::ResourceLayer::DESKTOP);
1450 } 1449 }
1451 stateSig().notify(); 1450 stateSig().emit(*this);
1452 1451
1453} 1452}
1454 1453
@@ -1483,7 +1482,7 @@ void FluxboxWindow::setMaximizedState(int type) {
1483 1482
1484 if (isShaded()) { 1483 if (isShaded()) {
1485 // do not call ::shade() here to trigger frame().applyState() and 1484 // do not call ::shade() here to trigger frame().applyState() and
1486 // stateSig().notfiy() only once 1485 // stateSig().emit() only once
1487 m_state.shaded = false; 1486 m_state.shaded = false;
1488 } 1487 }
1489 1488
@@ -1493,7 +1492,7 @@ void FluxboxWindow::setMaximizedState(int type) {
1493 attachWorkAreaSig(); 1492 attachWorkAreaSig();
1494 1493
1495 // notify listeners that we changed state 1494 // notify listeners that we changed state
1496 stateSig().notify(); 1495 stateSig().emit(*this);
1497} 1496}
1498 1497
1499void FluxboxWindow::disableMaximization() { 1498void FluxboxWindow::disableMaximization() {
@@ -1504,7 +1503,7 @@ void FluxboxWindow::disableMaximization() {
1504 m_state.saveGeometry(frame().x(), frame().y(), 1503 m_state.saveGeometry(frame().x(), frame().y(),
1505 frame().width(), frame().height()); 1504 frame().width(), frame().height());
1506 frame().applyState(); 1505 frame().applyState();
1507 stateSig().notify(); 1506 stateSig().emit(*this);
1508} 1507}
1509 1508
1510 1509
@@ -1560,7 +1559,7 @@ void FluxboxWindow::shade() {
1560 return; 1559 return;
1561 1560
1562 frame().applyState(); 1561 frame().applyState();
1563 stateSig().notify(); 1562 stateSig().emit(*this);
1564 // TODO: this should set IconicState, but then we can't focus the window 1563 // TODO: this should set IconicState, but then we can't focus the window
1565} 1564}
1566 1565
@@ -1584,7 +1583,7 @@ void FluxboxWindow::stick() {
1584 m_state.stuck = !m_state.stuck; 1583 m_state.stuck = !m_state.stuck;
1585 1584
1586 if (m_initialized) { 1585 if (m_initialized) {
1587 stateSig().notify(); 1586 stateSig().emit(*this);
1588 // notify since some things consider "stuck" to be a pseudo-workspace 1587 // notify since some things consider "stuck" to be a pseudo-workspace
1589 m_workspacesig.emit(*this); 1588 m_workspacesig.emit(*this);
1590 } 1589 }
@@ -1726,13 +1725,13 @@ void FluxboxWindow::moveToLayer(int layernum, bool force) {
1726void FluxboxWindow::setFocusHidden(bool value) { 1725void FluxboxWindow::setFocusHidden(bool value) {
1727 m_state.focus_hidden = value; 1726 m_state.focus_hidden = value;
1728 if (m_initialized) 1727 if (m_initialized)
1729 m_statesig.notify(); 1728 m_statesig.emit(*this);
1730} 1729}
1731 1730
1732void FluxboxWindow::setIconHidden(bool value) { 1731void FluxboxWindow::setIconHidden(bool value) {
1733 m_state.icon_hidden = value; 1732 m_state.icon_hidden = value;
1734 if (m_initialized) 1733 if (m_initialized)
1735 m_statesig.notify(); 1734 m_statesig.emit(*this);
1736} 1735}
1737 1736
1738 1737
@@ -2843,7 +2842,7 @@ void FluxboxWindow::stopMoving(bool interrupted) {
2843 if (m_state.maximized || m_state.fullscreen) { 2842 if (m_state.maximized || m_state.fullscreen) {
2844 frame().applyState(); 2843 frame().applyState();
2845 attachWorkAreaSig(); 2844 attachWorkAreaSig();
2846 stateSig().notify(); 2845 stateSig().emit(*this);
2847 } 2846 }
2848} 2847}
2849 2848
@@ -3581,7 +3580,8 @@ void FluxboxWindow::updateButtons() {
3581 0, 0, 10, 10); 3580 0, 0, 10, 10);
3582 3581
3583 winbtn->setOnClick(close_cmd); 3582 winbtn->setOnClick(close_cmd);
3584 stateSig().attach(winbtn); 3583 winbtn->join(stateSig(),
3584 FbTk::MemFunIgnoreArgs(*winbtn, &WinButton::updateAll));
3585 } 3585 }
3586 break; 3586 break;
3587 case WinButton::STICK: 3587 case WinButton::STICK:
@@ -3592,7 +3592,8 @@ void FluxboxWindow::updateButtons() {
3592 frame().titlebar(), 3592 frame().titlebar(),
3593 0, 0, 10, 10); 3593 0, 0, 10, 10);
3594 3594
3595 stateSig().attach(winbtn); 3595 winbtn->join(stateSig(),
3596 FbTk::MemFunIgnoreArgs(*winbtn, &WinButton::updateAll));
3596 winbtn->setOnClick(stick_cmd); 3597 winbtn->setOnClick(stick_cmd);
3597 } 3598 }
3598 break; 3599 break;
@@ -3603,7 +3604,8 @@ void FluxboxWindow::updateButtons() {
3603 dir[i], 3604 dir[i],
3604 frame().titlebar(), 3605 frame().titlebar(),
3605 0, 0, 10, 10); 3606 0, 0, 10, 10);
3606 stateSig().attach(winbtn); 3607 winbtn->join(stateSig(),
3608 FbTk::MemFunIgnoreArgs(*winbtn, &WinButton::updateAll));
3607 winbtn->setOnClick(shade_cmd); 3609 winbtn->setOnClick(shade_cmd);
3608 } 3610 }
3609 break; 3611 break;
@@ -3749,7 +3751,7 @@ void FluxboxWindow::setOnHead(int head) {
3749 if (m_state.maximized || m_state.fullscreen) { 3751 if (m_state.maximized || m_state.fullscreen) {
3750 frame().applyState(); 3752 frame().applyState();
3751 attachWorkAreaSig(); 3753 attachWorkAreaSig();
3752 stateSig().notify(); 3754 stateSig().emit(*this);
3753 } 3755 }
3754} 3756}
3755 3757