aboutsummaryrefslogtreecommitdiff
path: root/src/SendToMenu.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-11-28 13:39:41 (GMT)
committerfluxgen <fluxgen>2003-11-28 13:39:41 (GMT)
commit9f4d10256d27f60c09bb2a4b87805e308a3d52a6 (patch)
tree4fc9210a5bb63aa4d434b06942a27cb53cf91b4c /src/SendToMenu.cc
parent992d1224835994440e4a9288dc9204426eaa4a1c (diff)
downloadfluxbox-9f4d10256d27f60c09bb2a4b87805e308a3d52a6.zip
fluxbox-9f4d10256d27f60c09bb2a4b87805e308a3d52a6.tar.bz2
disable current workspace in menu
Diffstat (limited to 'src/SendToMenu.cc')
-rw-r--r--src/SendToMenu.cc21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/SendToMenu.cc b/src/SendToMenu.cc
index 9677107..a64e594 100644
--- a/src/SendToMenu.cc
+++ b/src/SendToMenu.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: SendToMenu.cc,v 1.2 2003/11/27 22:01:11 fluxgen Exp $ 23// $Id: SendToMenu.cc,v 1.3 2003/11/28 13:39:41 fluxgen Exp $
24 24
25#include "SendToMenu.hh" 25#include "SendToMenu.hh"
26 26
@@ -49,15 +49,32 @@ SendToMenu::SendToMenu(FluxboxWindow &win):
49 win.screen().imageControl(), 49 win.screen().imageControl(),
50 *win.screen().layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), 50 *win.screen().layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
51 m_win(win) { 51 m_win(win) {
52 52 // listen to:
53 // workspace count signal
54 // workspace names signal
55 // current workspace signal
53 win.screen().workspaceCountSig().attach(this); 56 win.screen().workspaceCountSig().attach(this);
54 win.screen().workspaceNamesSig().attach(this); 57 win.screen().workspaceNamesSig().attach(this);
58 win.screen().currentWorkspaceSig().attach(this);
55 59
56 disableTitle(); 60 disableTitle();
61 // build menu
57 update(0); 62 update(0);
58} 63}
59 64
60void SendToMenu::update(FbTk::Subject *subj) { 65void SendToMenu::update(FbTk::Subject *subj) {
66 // if workspace changed we enable all workspaces except the current one
67 if (subj != 0 && subj == &(m_win.screen().currentWorkspaceSig())) {
68 // enabled all workspaces
69 const BScreen::Workspaces &wlist = m_win.screen().getWorkspacesList();
70 for (size_t i = 0; i < wlist.size(); ++i)
71 setItemEnabled(i, true);
72 // disable current workspace
73 setItemEnabled(m_win.screen().currentWorkspaceID(), false);
74 // we're done
75 return;
76 }
77
61 // rebuild menu 78 // rebuild menu
62 79
63 removeAll(); 80 removeAll();