From 52e22a0304ef108e036cecc7c8808dc0bcf8d77b Mon Sep 17 00:00:00 2001 From: Henrik Kinnunen Date: Sun, 21 Sep 2008 19:32:40 +0200 Subject: Changed client list signal in BScreen to use the new signal system --- ChangeLog | 3 +++ src/FocusControl.cc | 4 ++-- src/Screen.cc | 7 +++---- src/Screen.hh | 4 ++-- src/fluxbox.cc | 18 +++++++++++------- src/fluxbox.hh | 2 ++ 6 files changed, 23 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5104aff..0c948ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ (Format: Year/Month/Day) Changes for 1.1.2 *08/09/21: + * Changed client list signal in BScreen to use the new signal system + (Henrik) + Screen.hh/cc, FocusControl.cc, fluxbox.hh/cc * Changed background changed signal in Bscreen to use the new signal system (Henrik) Screen.hh/cc,SystemTray.hh/cc,Slit.hh/cc 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) { m_focused_list.remove(client); m_creation_order_list.remove(client); - client.screen().clientListSig().notify(); + client.screen().clientListSig().emit(client.screen()); } void FocusControl::removeWindow(Focusable &win) { @@ -430,7 +430,7 @@ void FocusControl::removeWindow(Focusable &win) { m_focused_win_list.remove(win); m_creation_order_win_list.remove(win); - win.screen().clientListSig().notify(); + win.screen().clientListSig().emit(win.screen()); } void 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, const string &screenname, const string &altscreenname, int scrn, int num_layers) : - m_clientlist_sig(*this), // client signal m_iconlist_sig(*this), // icon list signal m_workspace_area_sig(*this), // workspace area signal m_focusedwindow_sig(*this), // focused window signal @@ -1130,7 +1129,7 @@ int BScreen::removeLastWorkspace() { if ((*it)->workspaceNumber() == wkspc->workspaceID()) (*it)->setWorkspace(wkspc->workspaceID()-1); } - m_clientlist_sig.notify(); + m_clientlist_sig.emit(*this); //remove last workspace m_workspaces_list.pop_back(); @@ -1373,7 +1372,7 @@ FluxboxWindow *BScreen::createWindow(Window client) { else if (other) // should never happen win->moveClientRightOf(*other, *winclient); - m_clientlist_sig.notify(); + m_clientlist_sig.emit(*this); FbTk::App::instance()->sync(false); return win; @@ -1407,7 +1406,7 @@ FluxboxWindow *BScreen::createWindow(WinClient &client) { && win->focus()) FocusControl::setFocusedWindow(&client); - m_clientlist_sig.notify(); + m_clientlist_sig.emit(*this); return win; } 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: //@{ typedef FbTk::Signal ScreenSignal; /// client list signal - FbTk::Subject &clientListSig() { return m_clientlist_sig; } + ScreenSignal &clientListSig() { return m_clientlist_sig; } /// icon list sig FbTk::Subject &iconListSig() { return m_iconlist_sig; } /// workspace count signal @@ -493,13 +493,13 @@ private: const Strut* availableWorkspaceArea(int head) const; ScreenSubject - m_clientlist_sig, ///< client signal m_iconlist_sig, ///< notify if a window gets iconified/deiconified m_workspace_area_sig, ///< workspace area changed signal m_focusedwindow_sig, ///< focused window signal m_reconfigure_sig, ///< reconfigure signal m_resize_sig; ///< resize signal + ScreenSignal m_clientlist_sig; ///< client signal ScreenSignal m_bg_change_sig; ///< background change signal ScreenSignal m_workspacecount_sig; ///< workspace count signal 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) { // attach screen signals to this screen->focusedWindowSig().attach(this); screen->workspaceAreaSig().attach(this); - screen->clientListSig().attach(this); + + join(screen->clientListSig(), + FbTk::MemFun(*this, &Fluxbox::clientListChanged)); join(screen->workspaceNamesSig(), FbTk::MemFun(*this, &Fluxbox::workspaceNamesChanged)); @@ -1117,12 +1119,6 @@ void Fluxbox::update(FbTk::Subject *changedsub) { if ((*it).first->update()) (*it).first->updateWorkarea(screen); } - } else if ((&(screen.clientListSig())) == changedsub) { - for (AtomHandlerContainerIt it= m_atomhandler.begin(); - it != m_atomhandler.end(); ++it) { - if ((*it).first->update()) - (*it).first->updateClientList(screen); - } } } } @@ -1533,3 +1529,11 @@ void Fluxbox::workspaceNamesChanged(BScreen &screen) { (*it).first->updateWorkspaceNames(screen); } } + +void Fluxbox::clientListChanged(BScreen &screen) { + for (AtomHandlerContainerIt it= m_atomhandler.begin(); + it != m_atomhandler.end(); ++it) { + if ((*it).first->update()) + (*it).first->updateClientList(screen); + } +} 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: void workspaceChanged(BScreen& screen); /// Called when workspace names changed void workspaceNamesChanged(BScreen &screen); + /// Called when the client list changed. + void clientListChanged(BScreen &screen); std::auto_ptr m_fbatoms; -- cgit v0.11.2