aboutsummaryrefslogtreecommitdiff
path: root/src/SendToMenu.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-12-04 00:08:55 (GMT)
committerfluxgen <fluxgen>2003-12-04 00:08:55 (GMT)
commita8f39f0d7a97dc1a4438b7df3a667895fb23604d (patch)
tree26390eeeb0ad1f41cc762a46d6ab07dd89c53afd /src/SendToMenu.cc
parentf7fc364a4cd6ca6ac89902880151045e55241502 (diff)
downloadfluxbox-a8f39f0d7a97dc1a4438b7df3a667895fb23604d.zip
fluxbox-a8f39f0d7a97dc1a4438b7df3a667895fb23604d.tar.bz2
fixed send to bug
Diffstat (limited to 'src/SendToMenu.cc')
-rw-r--r--src/SendToMenu.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/SendToMenu.cc b/src/SendToMenu.cc
index a64e594..4c154af 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.3 2003/11/28 13:39:41 fluxgen Exp $ 23// $Id: SendToMenu.cc,v 1.4 2003/12/04 00:08:55 fluxgen Exp $
24 24
25#include "SendToMenu.hh" 25#include "SendToMenu.hh"
26 26
@@ -53,9 +53,11 @@ SendToMenu::SendToMenu(FluxboxWindow &win):
53 // workspace count signal 53 // workspace count signal
54 // workspace names signal 54 // workspace names signal
55 // current workspace signal 55 // current workspace signal
56 // and window's workspace sig
56 win.screen().workspaceCountSig().attach(this); 57 win.screen().workspaceCountSig().attach(this);
57 win.screen().workspaceNamesSig().attach(this); 58 win.screen().workspaceNamesSig().attach(this);
58 win.screen().currentWorkspaceSig().attach(this); 59 win.screen().currentWorkspaceSig().attach(this);
60 win.workspaceSig().attach(this);
59 61
60 disableTitle(); 62 disableTitle();
61 // build menu 63 // build menu
@@ -64,13 +66,15 @@ SendToMenu::SendToMenu(FluxboxWindow &win):
64 66
65void SendToMenu::update(FbTk::Subject *subj) { 67void SendToMenu::update(FbTk::Subject *subj) {
66 // if workspace changed we enable all workspaces except the current one 68 // if workspace changed we enable all workspaces except the current one
67 if (subj != 0 && subj == &(m_win.screen().currentWorkspaceSig())) { 69 if (subj != 0 && (subj == &(m_win.screen().currentWorkspaceSig()) ||
70 subj == &(m_win.workspaceSig()))) {
68 // enabled all workspaces 71 // enabled all workspaces
69 const BScreen::Workspaces &wlist = m_win.screen().getWorkspacesList(); 72 const BScreen::Workspaces &wlist = m_win.screen().getWorkspacesList();
70 for (size_t i = 0; i < wlist.size(); ++i) 73 for (size_t i = 0; i < wlist.size(); ++i)
71 setItemEnabled(i, true); 74 setItemEnabled(i, true);
72 // disable current workspace 75 // disable send to on the workspace which the window exist
73 setItemEnabled(m_win.screen().currentWorkspaceID(), false); 76 setItemEnabled(m_win.workspaceNumber(), false);
77 FbMenu::update();
74 // we're done 78 // we're done
75 return; 79 return;
76 } 80 }
@@ -83,7 +87,10 @@ void SendToMenu::update(FbTk::Subject *subj) {
83 for (size_t i = 0; i < wlist.size(); ++i) { 87 for (size_t i = 0; i < wlist.size(); ++i) {
84 FbTk::RefCount<FbTk::Command> sendto_cmd(new SendToCmd(m_win, i)); 88 FbTk::RefCount<FbTk::Command> sendto_cmd(new SendToCmd(m_win, i));
85 insert(wlist[i]->name().c_str(), sendto_cmd); 89 insert(wlist[i]->name().c_str(), sendto_cmd);
90
86 } 91 }
87 92
93 setItemEnabled(m_win.workspaceNumber(), false);
94
88 FbMenu::update(); 95 FbMenu::update();
89} 96}