From 9288ae8eb0791eb52067edf4931f6f01fbcd640c Mon Sep 17 00:00:00 2001 From: mathias Date: Sat, 23 Apr 2005 10:03:06 +0000 Subject: close #956325 --- ChangeLog | 10 ++++++++++ src/SendToMenu.cc | 20 ++++++++++++++------ src/Workspace.cc | 12 +++++++++--- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index ec2e7ee..0cfd15f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,16 @@ (Format: Year/Month/Day) Changes for 0.9.13 *05/04/23: + * Close of #956325 (Mathias) + WorkspaceMenu -> left click on a item will jump TO that + workspace + -> middle click will fetch it to the current + workspac + SendToMenu -> left click send it quietly + -> middle click send it and follows to that + workspace + This should now match whats written in the manpage. + Workspace.cc SendToMenu.cc * Fixed #960535 aka Deiconify with apps set 'sticky' (Mathias) FbCommands.cc * Fixed #1020399 aka broken ShowDesktop - command (Mathias) diff --git a/src/SendToMenu.cc b/src/SendToMenu.cc index fee4c4d..c039f16 100644 --- a/src/SendToMenu.cc +++ b/src/SendToMenu.cc @@ -29,19 +29,22 @@ #include "fluxbox.hh" #include "Workspace.hh" +#include "FbTk/MultiButtonMenuItem.hh" #include "FbTk/Command.hh" class SendToCmd: public FbTk::Command { public: - SendToCmd(FluxboxWindow &win, int workspace): + SendToCmd(FluxboxWindow &win, int workspace, bool follow): m_win(win), - m_workspace(workspace) { } + m_workspace(workspace), + m_follow(follow) { } void execute() { - m_win.screen().sendToWorkspace(m_workspace, &m_win, false); + m_win.screen().sendToWorkspace(m_workspace, &m_win, m_follow); } private: FluxboxWindow &m_win; const int m_workspace; + const bool m_follow; }; SendToMenu::SendToMenu(FluxboxWindow &win): @@ -91,9 +94,14 @@ void SendToMenu::update(FbTk::Subject *subj) { const BScreen::Workspaces &wlist = m_win.screen().getWorkspacesList(); for (size_t i = 0; i < wlist.size(); ++i) { - FbTk::RefCount sendto_cmd(new SendToCmd(m_win, i)); - insert(wlist[i]->name().c_str(), sendto_cmd); - + FbTk::RefCount sendto_cmd(new SendToCmd(m_win, i, false)); + FbTk::RefCount sendto_follow_cmd(new SendToCmd(m_win, i, true)); + + FbTk::MultiButtonMenuItem* item = new FbTk::MultiButtonMenuItem(3, wlist[i]->name().c_str()); + item->setCommand(1, sendto_cmd); + item->setCommand(2, sendto_follow_cmd); + item->setCommand(3, sendto_cmd); + insert(item); } setItemEnabled(m_win.workspaceNumber(), false); diff --git a/src/Workspace.cc b/src/Workspace.cc index bf914fc..4985c39 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -92,9 +92,15 @@ public: return; FluxboxWindow &win = *m_client.fbwindow(); - win.screen().changeWorkspaceID(win.workspaceNumber()); - win.setCurrentClient(m_client); - win.raiseAndFocus(); + // fetch the window to the current workspace + if (button == 2 && win.screen().currentWorkspaceID() != win.workspaceNumber()) { + win.menu().hide(); + win.screen().sendToWorkspace(win.screen().currentWorkspaceID(), &win, true); + } else { // warp to the workspace of the window + win.screen().changeWorkspaceID(win.workspaceNumber()); + win.setCurrentClient(m_client); + win.raiseAndFocus(); + } } const std::string &label() const { return m_client.title(); } -- cgit v0.11.2