aboutsummaryrefslogtreecommitdiff
path: root/src/fluxbox.cc
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-05-06 18:28:44 (GMT)
committerPavel Labath <pavelo@centrum.sk>2011-05-10 11:00:46 (GMT)
commite53d14e9102270a1682a88c29161580ccbf0c20a (patch)
tree26c5b238119073d69c650a970447685d20a463af /src/fluxbox.cc
parentad0951ca539d23f8f0ed9a1e8519feacc2ef907c (diff)
downloadfluxbox-e53d14e9102270a1682a88c29161580ccbf0c20a.zip
fluxbox-e53d14e9102270a1682a88c29161580ccbf0c20a.tar.bz2
Convert FluxboxWindow::stateSig to FbTk::Signal
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r--src/fluxbox.cc49
1 files changed, 24 insertions, 25 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index e319a2f..9c30b03 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -952,30 +952,7 @@ void Fluxbox::update(FbTk::Subject *changedsub) {
952 fbwin = winsub->win().fbwindow(); 952 fbwin = winsub->win().fbwindow();
953 } 953 }
954 954
955 if (fbwin && &fbwin->stateSig() == changedsub) { // state signal 955 if (fbwin && &fbwin->layerSig() == changedsub) { // layer signal
956 STLUtil::forAllIf(m_atomhandler, mem_fun(&AtomHandler::update),
957 CallMemFunWithRefArg<AtomHandler, FluxboxWindow&, void>(&AtomHandler::updateState, *fbwin));
958
959 // if window changed to iconic state
960 // add to icon list
961 if (fbwin->isIconic()) {
962 fbwin->screen().addIcon(fbwin);
963 Workspace *space = fbwin->screen().getWorkspace(fbwin->workspaceNumber());
964 if (space != 0)
965 space->removeWindow(fbwin, true);
966 }
967
968 if (fbwin->isStuck()) {
969 // if we're sticky then reassociate window
970 // to all workspaces
971 BScreen &scr = fbwin->screen();
972 if (scr.currentWorkspaceID() != fbwin->workspaceNumber()) {
973 scr.reassociateWindow(fbwin,
974 scr.currentWorkspaceID(),
975 true);
976 }
977 }
978 } else if (fbwin && &fbwin->layerSig() == changedsub) { // layer signal
979 STLUtil::forAllIf(m_atomhandler, mem_fun(&AtomHandler::update), 956 STLUtil::forAllIf(m_atomhandler, mem_fun(&AtomHandler::update),
980 CallMemFunWithRefArg<AtomHandler, FluxboxWindow&, void>(&AtomHandler::updateLayer, *fbwin)); 957 CallMemFunWithRefArg<AtomHandler, FluxboxWindow&, void>(&AtomHandler::updateLayer, *fbwin));
981 } 958 }
@@ -1025,9 +1002,31 @@ void Fluxbox::windowWorkspaceChanged(FluxboxWindow &win) {
1025 CallMemFunWithRefArg<AtomHandler, FluxboxWindow&, void>(&AtomHandler::updateWorkspace, win)); 1002 CallMemFunWithRefArg<AtomHandler, FluxboxWindow&, void>(&AtomHandler::updateWorkspace, win));
1026} 1003}
1027 1004
1005void Fluxbox::windowStateChanged(FluxboxWindow &win) {
1006 STLUtil::forAllIf(m_atomhandler, mem_fun(&AtomHandler::update),
1007 CallMemFunWithRefArg<AtomHandler, FluxboxWindow&, void>(&AtomHandler::updateState, win));
1008
1009 // if window changed to iconic state
1010 // add to icon list
1011 if (win.isIconic()) {
1012 win.screen().addIcon(&win);
1013 Workspace *space = win.screen().getWorkspace(win.workspaceNumber());
1014 if (space != 0)
1015 space->removeWindow(&win, true);
1016 }
1017
1018 if (win.isStuck()) {
1019 // if we're sticky then reassociate window
1020 // to all workspaces
1021 BScreen &scr = win.screen();
1022 if (scr.currentWorkspaceID() != win.workspaceNumber())
1023 scr.reassociateWindow(&win, scr.currentWorkspaceID(), true);
1024 }
1025}
1026
1028void Fluxbox::attachSignals(FluxboxWindow &win) { 1027void Fluxbox::attachSignals(FluxboxWindow &win) {
1029 win.hintSig().attach(this); 1028 win.hintSig().attach(this);
1030 win.stateSig().attach(this); 1029 join(win.stateSig(), FbTk::MemFun(*this, &Fluxbox::windowStateChanged));
1031 join(win.workspaceSig(), FbTk::MemFun(*this, &Fluxbox::windowWorkspaceChanged)); 1030 join(win.workspaceSig(), FbTk::MemFun(*this, &Fluxbox::windowWorkspaceChanged));
1032 win.layerSig().attach(this); 1031 win.layerSig().attach(this);
1033 join(win.dieSig(), FbTk::MemFun(*this, &Fluxbox::windowDied)); 1032 join(win.dieSig(), FbTk::MemFun(*this, &Fluxbox::windowDied));