all repos — fluxbox @ e9be87766bd5e3353217d49037f971d43e548d3a

custom fork of the fluxbox windowmanager

observe title signal
fluxgen fluxgen
commit

e9be87766bd5e3353217d49037f971d43e548d3a

parent

b8c1d3e5ee0674bfe33d6af78cb6d3ff5cf1d85e

2 files changed, 13 insertions(+), 29 deletions(-)

jump to
M src/Workspace.ccsrc/Workspace.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Workspace.cc,v 1.84 2003/12/03 23:05:29 fluxgen Exp $ +// $Id: Workspace.cc,v 1.85 2003/12/07 17:49:07 fluxgen Exp $ #include "Workspace.hh"

@@ -157,6 +157,8 @@ m_windowlist.end())

return; w.setWorkspace(m_id); + // attach signals + w.titleSig().attach(this); if (place) placeWindow(w);

@@ -180,6 +182,9 @@ int Workspace::removeWindow(FluxboxWindow *w) {

if (w == 0) return -1; + + // detach from signals + w->titleSig().detach(this); if (m_lastfocus == w) { m_lastfocus = 0;

@@ -231,20 +236,6 @@

return m_windowlist.size(); } -void Workspace::removeWindow(WinClient &client) { - if (client.m_win == 0) - return; - - if (client.m_win->numClients() == 0) { - Windows::iterator erase_it = remove(m_windowlist.begin(), - m_windowlist.end(), client.m_win); - if (erase_it != m_windowlist.end()) - m_windowlist.erase(erase_it); - } - - updateClientmenu(); -} - void Workspace::showAll() { Windows::iterator it = m_windowlist.begin(); Windows::iterator it_end = m_windowlist.end();

@@ -378,7 +369,7 @@

return true; } -void Workspace::update() { +void Workspace::update(FbTk::Subject *subj) { m_clientmenu.update(); }

@@ -407,13 +398,6 @@ on the workspace and then

clears the m_windowlist */ void Workspace::shutdown() { -#ifdef DEBUG - cerr<<__FILE__<<"("<<__FUNCTION__<<"): scr "<<screen().screenNumber()<<", ws "<< - m_id<<", windowlist:"<<endl; - copy(m_windowlist.begin(), m_windowlist.end(), - ostream_iterator<FluxboxWindow *>(cerr, " \n")); - cerr<<endl; -#endif // DEBUG // note: when the window dies it'll remove it self from the list while (!m_windowlist.empty()) { // restore with remap on all clients in that window
M src/Workspace.hhsrc/Workspace.hh

@@ -25,12 +25,13 @@

#ifndef WORKSPACE_HH #define WORKSPACE_HH -#include "NotCopyable.hh" + #include "FbMenu.hh" -#include "MultLayers.hh" -#include <X11/Xlib.h> +#include "FbTk/MultLayers.hh" +#include "FbTk/Observer.hh" +#include "FbTk/NotCopyable.hh" #include <string> #include <vector>

@@ -43,7 +44,7 @@

/** Handles a single workspace */ -class Workspace:private FbTk::NotCopyable { +class Workspace:private FbTk::NotCopyable, private FbTk::Observer { public: typedef std::vector<FluxboxWindow *> Windows;

@@ -59,11 +60,9 @@ void showAll();

void hideAll(); void removeAll(); void reconfigure(); - void update(); void shutdown(); void addWindow(FluxboxWindow &win, bool place = false); int removeWindow(FluxboxWindow *win); - void removeWindow(WinClient &client); void updateClientmenu(); BScreen &screen() { return m_screen; }

@@ -90,6 +89,7 @@

static bool loadGroups(const std::string &filename); private: + void update(FbTk::Subject *subj); void placeWindow(FluxboxWindow &win); BScreen &m_screen;