all repos — fluxbox @ 52e22a0304ef108e036cecc7c8808dc0bcf8d77b

custom fork of the fluxbox windowmanager

Changed client list signal in BScreen to use the new signal system
Henrik Kinnunen fluxgen@fluxbox.org
commit

52e22a0304ef108e036cecc7c8808dc0bcf8d77b

parent

d05804e6661d4976ba52ef8727ec8387e2e3bba1

6 files changed, 23 insertions(+), 15 deletions(-)

jump to
M ChangeLogChangeLog

@@ -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
M src/FocusControl.ccsrc/FocusControl.cc

@@ -415,7 +415,7 @@ m_cycling_last = 0;

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 @@ }

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() {
M src/Screen.ccsrc/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 @@ for (; it != it_end; ++it) {

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 @@ win->attachClient(*other);

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 @@ if ((focusControl().focusNew() || FocusControl::focusedWindow() == &client)

&& win->focus()) FocusControl::setFocusedWindow(&client); - m_clientlist_sig.notify(); + m_clientlist_sig.emit(*this); return win; }
M src/Screen.hhsrc/Screen.hh

@@ -211,7 +211,7 @@ */

//@{ typedef FbTk::Signal<void, BScreen&> 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 @@

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
M src/fluxbox.ccsrc/fluxbox.cc

@@ -455,7 +455,9 @@

// 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 @@ it != m_atomhandler.end(); ++it) {

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 @@ if ((*it).first->update())

(*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); + } +}
M src/fluxbox.hhsrc/fluxbox.hh

@@ -207,6 +207,8 @@ /// Called when workspace was switched

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<FbAtoms> m_fbatoms;