diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-05-06 20:26:20 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2011-05-10 11:00:46 (GMT) |
commit | 6a0280aa4d8b468617a7dd5f7a6523d0422364e8 (patch) | |
tree | e85f742583d112f8d970c0523537aacdb1926726 /src/fluxbox.cc | |
parent | e53d14e9102270a1682a88c29161580ccbf0c20a (diff) | |
download | fluxbox-6a0280aa4d8b468617a7dd5f7a6523d0422364e8.zip fluxbox-6a0280aa4d8b468617a7dd5f7a6523d0422364e8.tar.bz2 |
Convert FluxboxWindow::layerSig to FbTk::Signal
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r-- | src/fluxbox.cc | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 9c30b03..0dc958d 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc | |||
@@ -940,24 +940,6 @@ void Fluxbox::handleSignal(int signum) { | |||
940 | } | 940 | } |
941 | 941 | ||
942 | 942 | ||
943 | void Fluxbox::update(FbTk::Subject *changedsub) { | ||
944 | //TODO: fix signaling, this does not look good | ||
945 | FluxboxWindow *fbwin = 0; | ||
946 | |||
947 | if (typeid(*changedsub) == typeid(FluxboxWindow::WinSubject)) { | ||
948 | FluxboxWindow::WinSubject *winsub = dynamic_cast<FluxboxWindow::WinSubject *>(changedsub); | ||
949 | fbwin = &winsub->win(); | ||
950 | } else if (typeid(*changedsub) == typeid(Focusable::FocusSubject)) { | ||
951 | Focusable::FocusSubject *winsub = dynamic_cast<Focusable::FocusSubject *>(changedsub); | ||
952 | fbwin = winsub->win().fbwindow(); | ||
953 | } | ||
954 | |||
955 | if (fbwin && &fbwin->layerSig() == changedsub) { // layer signal | ||
956 | STLUtil::forAllIf(m_atomhandler, mem_fun(&AtomHandler::update), | ||
957 | CallMemFunWithRefArg<AtomHandler, FluxboxWindow&, void>(&AtomHandler::updateLayer, *fbwin)); | ||
958 | } | ||
959 | } | ||
960 | |||
961 | void Fluxbox::windowDied(Focusable &focusable) { | 943 | void Fluxbox::windowDied(Focusable &focusable) { |
962 | FluxboxWindow *fbwin = focusable.fbwindow(); | 944 | FluxboxWindow *fbwin = focusable.fbwindow(); |
963 | 945 | ||
@@ -1024,11 +1006,15 @@ void Fluxbox::windowStateChanged(FluxboxWindow &win) { | |||
1024 | } | 1006 | } |
1025 | } | 1007 | } |
1026 | 1008 | ||
1009 | void Fluxbox::windowLayerChanged(FluxboxWindow &win) { | ||
1010 | STLUtil::forAllIf(m_atomhandler, mem_fun(&AtomHandler::update), | ||
1011 | CallMemFunWithRefArg<AtomHandler, FluxboxWindow&, void>(&AtomHandler::updateLayer, win)); | ||
1012 | } | ||
1013 | |||
1027 | void Fluxbox::attachSignals(FluxboxWindow &win) { | 1014 | void Fluxbox::attachSignals(FluxboxWindow &win) { |
1028 | win.hintSig().attach(this); | ||
1029 | join(win.stateSig(), FbTk::MemFun(*this, &Fluxbox::windowStateChanged)); | 1015 | join(win.stateSig(), FbTk::MemFun(*this, &Fluxbox::windowStateChanged)); |
1030 | join(win.workspaceSig(), FbTk::MemFun(*this, &Fluxbox::windowWorkspaceChanged)); | 1016 | join(win.workspaceSig(), FbTk::MemFun(*this, &Fluxbox::windowWorkspaceChanged)); |
1031 | win.layerSig().attach(this); | 1017 | join(win.layerSig(), FbTk::MemFun(*this, &Fluxbox::windowLayerChanged)); |
1032 | join(win.dieSig(), FbTk::MemFun(*this, &Fluxbox::windowDied)); | 1018 | join(win.dieSig(), FbTk::MemFun(*this, &Fluxbox::windowDied)); |
1033 | STLUtil::forAll(m_atomhandler, | 1019 | STLUtil::forAll(m_atomhandler, |
1034 | CallMemFunWithRefArg<AtomHandler, FluxboxWindow&, void>(&AtomHandler::setupFrame, win)); | 1020 | CallMemFunWithRefArg<AtomHandler, FluxboxWindow&, void>(&AtomHandler::setupFrame, win)); |