diff options
Diffstat (limited to 'src/SendToMenu.cc')
-rw-r--r-- | src/SendToMenu.cc | 15 |
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 | ||
65 | void SendToMenu::update(FbTk::Subject *subj) { | 67 | void 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 | } |