all repos — fluxbox @ 188d53a879f1c61c95f0c281c3100b08e57df2f4

custom fork of the fluxbox windowmanager

added remove/add workspace
fluxgen fluxgen
commit

188d53a879f1c61c95f0c281c3100b08e57df2f4

parent

0cba1e7dffae670d1a4bbaa6fb300d6888f1e7ce

2 files changed, 25 insertions(+), 8 deletions(-)

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

@@ -1,3 +1,5 @@

+// Workspacemenu.cc for Fluxbox +// Copyright (c) 2002 Henrik Kinnunen (fluxgen@linuxmail.org) // Workspacemenu.cc for Blackbox - an X11 Window manager // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) //

@@ -35,7 +37,8 @@ #include "Screen.hh"

#include "Toolbar.hh" #include "Workspacemenu.hh" #include "Workspace.hh" - +#include <iostream> +#include <cassert> Workspacemenu::Workspacemenu(BScreen *scrn) : Basemenu(scrn) { screen = scrn;

@@ -82,3 +85,19 @@ if (! (screen->getWorkspacemenu()->isTorn() || isTorn()))

hide(); } } + +void Workspacemenu::removeWorkspace(unsigned int id) { + if (id<getCount()) { + remove(id+2); // + 2 is where workspaces starts + #ifdef DEBUG + using namespace std; + cerr<<__FILE__<<"("<<__LINE__<<"): Removing "<<id<<endl; + #endif + } +} + +void Workspacemenu::addWorkspace(Workspace *wkspc) { + assert(wkspc); + insert(wkspc->getName(), wkspc->getMenu(), + wkspc->getWorkspaceID() + 2); +}
M src/Workspacemenu.hhsrc/Workspacemenu.hh

@@ -1,3 +1,5 @@

+// Workspacemenu.hh for Fluxbox +// Copyright (c) 2002 Henrik Kinnunen (fluxgen@linuxmail.org) // WorkspaceMenu.hh for Blackbox - an X11 Window manager // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) //

@@ -22,24 +24,20 @@

#ifndef WORKSPACEMENU_HH #define WORKSPACEMENU_HH -// forward declaration -class Workspacemenu; -class Toolbar; - #include "Basemenu.hh" - +class Workspace; class Workspacemenu : public Basemenu { private: BScreen *screen; - protected: virtual void itemSelected(int, int); - public: Workspacemenu(BScreen *); + void removeWorkspace(unsigned int id); + void addWorkspace(Workspace *wkspc); };