all repos — fluxbox @ 9288ae8eb0791eb52067edf4931f6f01fbcd640c

custom fork of the fluxbox windowmanager

close #956325
mathias mathias
commit

9288ae8eb0791eb52067edf4931f6f01fbcd640c

parent

efe4ead2144469efc567966304c842fabcc7856e

3 files changed, 33 insertions(+), 9 deletions(-)

jump to
M ChangeLogChangeLog

@@ -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)
M src/SendToMenu.ccsrc/SendToMenu.cc

@@ -29,19 +29,22 @@ #include "Screen.hh"

#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 @@ removeAll();

const BScreen::Workspaces &wlist = m_win.screen().getWorkspacesList(); for (size_t i = 0; i < wlist.size(); ++i) { - FbTk::RefCount<FbTk::Command> sendto_cmd(new SendToCmd(m_win, i)); - insert(wlist[i]->name().c_str(), sendto_cmd); - + FbTk::RefCount<FbTk::Command> sendto_cmd(new SendToCmd(m_win, i, false)); + FbTk::RefCount<FbTk::Command> 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);
M src/Workspace.ccsrc/Workspace.cc

@@ -92,9 +92,15 @@ if (m_client.fbwindow() == 0)

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(); }