aboutsummaryrefslogtreecommitdiff
path: root/src/FocusableList.cc
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-05-03 21:48:24 (GMT)
committerPavel Labath <pavelo@centrum.sk>2011-05-10 11:00:45 (GMT)
commit129bac1e0f0979c80902edc8e092596b81fe14f6 (patch)
tree0624ee5da85ec2d1f758612cddae2e95a50249f9 /src/FocusableList.cc
parent0775350fee345e37fb59835dda4d85664346b606 (diff)
downloadfluxbox_pavel-129bac1e0f0979c80902edc8e092596b81fe14f6.zip
fluxbox_pavel-129bac1e0f0979c80902edc8e092596b81fe14f6.tar.bz2
Convert Focusable::dieSig to FbTk::Signal
Diffstat (limited to 'src/FocusableList.cc')
-rw-r--r--src/FocusableList.cc28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/FocusableList.cc b/src/FocusableList.cc
index 748e940..a130ec0 100644
--- a/src/FocusableList.cc
+++ b/src/FocusableList.cc
@@ -111,13 +111,6 @@ void FocusableList::update(FbTk::Subject *subj) {
111 if (subj == 0 || m_screen.isShuttingdown()) 111 if (subj == 0 || m_screen.isShuttingdown())
112 return; 112 return;
113 113
114 if (typeid(*subj) == typeid(Focusable::FocusSubject)) {
115 Focusable::FocusSubject *fsubj =
116 static_cast<Focusable::FocusSubject *>(subj);
117 if (fsubj == &fsubj->win().dieSig()) {
118 remove(fsubj->win());
119 }
120 }
121 if (typeid(*subj) == typeid(FluxboxWindow::WinSubject)) { 114 if (typeid(*subj) == typeid(FluxboxWindow::WinSubject)) {
122 FluxboxWindow::WinSubject *fsubj = 115 FluxboxWindow::WinSubject *fsubj =
123 static_cast<FluxboxWindow::WinSubject *>(subj); 116 static_cast<FluxboxWindow::WinSubject *>(subj);
@@ -254,15 +247,17 @@ void FocusableList::remove(Focusable &win) {
254void FocusableList::updateTitle(Focusable& win) { 247void FocusableList::updateTitle(Focusable& win) {
255 checkUpdate(win); 248 checkUpdate(win);
256} 249}
250#include "Debug.hh"
257 251
258void FocusableList::attachSignals(Focusable &win) { 252void FocusableList::attachSignals(Focusable &win) {
259 win.dieSig().attach(this);
260 if (m_parent) { 253 if (m_parent) {
261 // attach various signals for matching 254 // attach various signals for matching
262 if (m_signal_map.find(&win) == m_signal_map.end()) { 255 FbTk::RefCount<FbTk::SignalTracker> &tracker = m_signal_map[&win];
263 m_signal_map[&win] = join(win.titleSig(), 256 if (! tracker) {
264 MemFunSelectArg1(*this, 257 // we have not attached to this window yet
265 &FocusableList::updateTitle)); 258 tracker = new SignalTracker;
259 tracker->join(win.titleSig(), MemFunSelectArg1(*this, &FocusableList::updateTitle));
260 tracker->join(win.dieSig(), MemFun(*this, &FocusableList::remove));
266 } 261 }
267 262
268 FluxboxWindow *fbwin = win.fbwindow(); 263 FluxboxWindow *fbwin = win.fbwindow();
@@ -276,15 +271,8 @@ void FocusableList::attachSignals(Focusable &win) {
276} 271}
277 272
278void FocusableList::detachSignals(Focusable &win) { 273void FocusableList::detachSignals(Focusable &win) {
279 win.dieSig().detach(this); 274 m_signal_map.erase(&win);
280 if (m_parent) { 275 if (m_parent) {
281 // disconnect client
282 SignalMap::iterator sigIt = m_signal_map.find(&win);
283 if (sigIt != m_signal_map.end()) {
284 leave(sigIt->second);
285 m_signal_map.erase(sigIt);
286 }
287
288 // detach various signals for matching 276 // detach various signals for matching
289 FluxboxWindow *fbwin = win.fbwindow(); 277 FluxboxWindow *fbwin = win.fbwindow();
290 if (!fbwin) 278 if (!fbwin)