aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHenrik Kinnunen <fluxgen@fluxbox.org>2008-09-21 17:32:40 (GMT)
committerHenrik Kinnunen <fluxgen@fluxbox.org>2008-09-21 17:32:40 (GMT)
commit52e22a0304ef108e036cecc7c8808dc0bcf8d77b (patch)
treee3f3d36b84be954b8193262e77468d72a325326f /src
parentd05804e6661d4976ba52ef8727ec8387e2e3bba1 (diff)
downloadfluxbox-52e22a0304ef108e036cecc7c8808dc0bcf8d77b.zip
fluxbox-52e22a0304ef108e036cecc7c8808dc0bcf8d77b.tar.bz2
Changed client list signal in BScreen to use the new signal system
Diffstat (limited to 'src')
-rw-r--r--src/FocusControl.cc4
-rw-r--r--src/Screen.cc7
-rw-r--r--src/Screen.hh4
-rw-r--r--src/fluxbox.cc18
-rw-r--r--src/fluxbox.hh2
5 files changed, 20 insertions, 15 deletions
diff --git a/src/FocusControl.cc b/src/FocusControl.cc
index cead827..6533ac1 100644
--- a/src/FocusControl.cc
+++ b/src/FocusControl.cc
@@ -415,7 +415,7 @@ void FocusControl::removeClient(WinClient &client) {
415 415
416 m_focused_list.remove(client); 416 m_focused_list.remove(client);
417 m_creation_order_list.remove(client); 417 m_creation_order_list.remove(client);
418 client.screen().clientListSig().notify(); 418 client.screen().clientListSig().emit(client.screen());
419} 419}
420 420
421void FocusControl::removeWindow(Focusable &win) { 421void FocusControl::removeWindow(Focusable &win) {
@@ -430,7 +430,7 @@ void FocusControl::removeWindow(Focusable &win) {
430 430
431 m_focused_win_list.remove(win); 431 m_focused_win_list.remove(win);
432 m_creation_order_win_list.remove(win); 432 m_creation_order_win_list.remove(win);
433 win.screen().clientListSig().notify(); 433 win.screen().clientListSig().emit(win.screen());
434} 434}
435 435
436void FocusControl::shutdown() { 436void FocusControl::shutdown() {
diff --git a/src/Screen.cc b/src/Screen.cc
index 8809609..2d55b31 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -339,7 +339,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
339 const string &screenname, 339 const string &screenname,
340 const string &altscreenname, 340 const string &altscreenname,
341 int scrn, int num_layers) : 341 int scrn, int num_layers) :
342 m_clientlist_sig(*this), // client signal
343 m_iconlist_sig(*this), // icon list signal 342 m_iconlist_sig(*this), // icon list signal
344 m_workspace_area_sig(*this), // workspace area signal 343 m_workspace_area_sig(*this), // workspace area signal
345 m_focusedwindow_sig(*this), // focused window signal 344 m_focusedwindow_sig(*this), // focused window signal
@@ -1130,7 +1129,7 @@ int BScreen::removeLastWorkspace() {
1130 if ((*it)->workspaceNumber() == wkspc->workspaceID()) 1129 if ((*it)->workspaceNumber() == wkspc->workspaceID())
1131 (*it)->setWorkspace(wkspc->workspaceID()-1); 1130 (*it)->setWorkspace(wkspc->workspaceID()-1);
1132 } 1131 }
1133 m_clientlist_sig.notify(); 1132 m_clientlist_sig.emit(*this);
1134 1133
1135 //remove last workspace 1134 //remove last workspace
1136 m_workspaces_list.pop_back(); 1135 m_workspaces_list.pop_back();
@@ -1373,7 +1372,7 @@ FluxboxWindow *BScreen::createWindow(Window client) {
1373 else if (other) // should never happen 1372 else if (other) // should never happen
1374 win->moveClientRightOf(*other, *winclient); 1373 win->moveClientRightOf(*other, *winclient);
1375 1374
1376 m_clientlist_sig.notify(); 1375 m_clientlist_sig.emit(*this);
1377 1376
1378 FbTk::App::instance()->sync(false); 1377 FbTk::App::instance()->sync(false);
1379 return win; 1378 return win;
@@ -1407,7 +1406,7 @@ FluxboxWindow *BScreen::createWindow(WinClient &client) {
1407 && win->focus()) 1406 && win->focus())
1408 FocusControl::setFocusedWindow(&client); 1407 FocusControl::setFocusedWindow(&client);
1409 1408
1410 m_clientlist_sig.notify(); 1409 m_clientlist_sig.emit(*this);
1411 1410
1412 return win; 1411 return win;
1413} 1412}
diff --git a/src/Screen.hh b/src/Screen.hh
index 00ab2e5..263d4ba 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -211,7 +211,7 @@ public:
211 //@{ 211 //@{
212 typedef FbTk::Signal<void, BScreen&> ScreenSignal; 212 typedef FbTk::Signal<void, BScreen&> ScreenSignal;
213 /// client list signal 213 /// client list signal
214 FbTk::Subject &clientListSig() { return m_clientlist_sig; } 214 ScreenSignal &clientListSig() { return m_clientlist_sig; }
215 /// icon list sig 215 /// icon list sig
216 FbTk::Subject &iconListSig() { return m_iconlist_sig; } 216 FbTk::Subject &iconListSig() { return m_iconlist_sig; }
217 /// workspace count signal 217 /// workspace count signal
@@ -493,13 +493,13 @@ private:
493 const Strut* availableWorkspaceArea(int head) const; 493 const Strut* availableWorkspaceArea(int head) const;
494 494
495 ScreenSubject 495 ScreenSubject
496 m_clientlist_sig, ///< client signal
497 m_iconlist_sig, ///< notify if a window gets iconified/deiconified 496 m_iconlist_sig, ///< notify if a window gets iconified/deiconified
498 m_workspace_area_sig, ///< workspace area changed signal 497 m_workspace_area_sig, ///< workspace area changed signal
499 m_focusedwindow_sig, ///< focused window signal 498 m_focusedwindow_sig, ///< focused window signal
500 m_reconfigure_sig, ///< reconfigure signal 499 m_reconfigure_sig, ///< reconfigure signal
501 m_resize_sig; ///< resize signal 500 m_resize_sig; ///< resize signal
502 501
502 ScreenSignal m_clientlist_sig; ///< client signal
503 ScreenSignal m_bg_change_sig; ///< background change signal 503 ScreenSignal m_bg_change_sig; ///< background change signal
504 ScreenSignal m_workspacecount_sig; ///< workspace count signal 504 ScreenSignal m_workspacecount_sig; ///< workspace count signal
505 ScreenSignal m_currentworkspace_sig; ///< current workspace signal 505 ScreenSignal m_currentworkspace_sig; ///< current workspace signal
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index e9c548c..3a07060 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -455,7 +455,9 @@ void Fluxbox::initScreen(BScreen *screen) {
455 // attach screen signals to this 455 // attach screen signals to this
456 screen->focusedWindowSig().attach(this); 456 screen->focusedWindowSig().attach(this);
457 screen->workspaceAreaSig().attach(this); 457 screen->workspaceAreaSig().attach(this);
458 screen->clientListSig().attach(this); 458
459 join(screen->clientListSig(),
460 FbTk::MemFun(*this, &Fluxbox::clientListChanged));
459 461
460 join(screen->workspaceNamesSig(), 462 join(screen->workspaceNamesSig(),
461 FbTk::MemFun(*this, &Fluxbox::workspaceNamesChanged)); 463 FbTk::MemFun(*this, &Fluxbox::workspaceNamesChanged));
@@ -1117,12 +1119,6 @@ void Fluxbox::update(FbTk::Subject *changedsub) {
1117 if ((*it).first->update()) 1119 if ((*it).first->update())
1118 (*it).first->updateWorkarea(screen); 1120 (*it).first->updateWorkarea(screen);
1119 } 1121 }
1120 } else if ((&(screen.clientListSig())) == changedsub) {
1121 for (AtomHandlerContainerIt it= m_atomhandler.begin();
1122 it != m_atomhandler.end(); ++it) {
1123 if ((*it).first->update())
1124 (*it).first->updateClientList(screen);
1125 }
1126 } 1122 }
1127 } 1123 }
1128} 1124}
@@ -1533,3 +1529,11 @@ void Fluxbox::workspaceNamesChanged(BScreen &screen) {
1533 (*it).first->updateWorkspaceNames(screen); 1529 (*it).first->updateWorkspaceNames(screen);
1534 } 1530 }
1535} 1531}
1532
1533void Fluxbox::clientListChanged(BScreen &screen) {
1534 for (AtomHandlerContainerIt it= m_atomhandler.begin();
1535 it != m_atomhandler.end(); ++it) {
1536 if ((*it).first->update())
1537 (*it).first->updateClientList(screen);
1538 }
1539}
diff --git a/src/fluxbox.hh b/src/fluxbox.hh
index 82740d4..c15aa8a 100644
--- a/src/fluxbox.hh
+++ b/src/fluxbox.hh
@@ -207,6 +207,8 @@ private:
207 void workspaceChanged(BScreen& screen); 207 void workspaceChanged(BScreen& screen);
208 /// Called when workspace names changed 208 /// Called when workspace names changed
209 void workspaceNamesChanged(BScreen &screen); 209 void workspaceNamesChanged(BScreen &screen);
210 /// Called when the client list changed.
211 void clientListChanged(BScreen &screen);
210 212
211 std::auto_ptr<FbAtoms> m_fbatoms; 213 std::auto_ptr<FbAtoms> m_fbatoms;
212 214