all repos — fluxbox @ cdc4338c6b7175e0c2654e42a01ae575722f4fd1

custom fork of the fluxbox windowmanager

Fixes #1213003, SendToWorkspace shouldnt follow
SendToWorkspace and the rest are putting the window onto the new workspace
silently, TakeToWorkspace warps to the new workspace with the window.
mathias mathias
commit

cdc4338c6b7175e0c2654e42a01ae575722f4fd1

parent

acaa58309364238371dec1c30d8fe5097843fd57

4 files changed, 61 insertions(+), 2 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,6 +1,10 @@

(Format: Year/Month/Day) Changes for 0.9.14: *05/06/15: + * Fixes #1213003, SendToWorkspace shouldnt follow (Mathias) + - SendToWorkspace silently changes the workspace of the window + - TakeToWorkspace takes the window and puts it onto the ws + FbCommandFactory.cc CurrentWindowCmd.cc/hh * Fixes #1216020, *.font.effect wont get cleared if not defined in style (Mathias) FbTk/Font.cc *05/06/09:
M src/CurrentWindowCmd.ccsrc/CurrentWindowCmd.cc

@@ -48,17 +48,35 @@ }

void SendToWorkspaceCmd::real_execute() { if (m_workspace_num >= 0 && m_workspace_num < fbwindow().screen().getNumberOfWorkspaces()) - fbwindow().screen().sendToWorkspace(m_workspace_num, &fbwindow()); + fbwindow().screen().sendToWorkspace(m_workspace_num, &fbwindow(), false); } void SendToNextWorkspaceCmd::real_execute() { + const int ws_nr = + ( fbwindow().screen().currentWorkspaceID() + m_workspace_num ) % + fbwindow().screen().getNumberOfWorkspaces(); + fbwindow().screen().sendToWorkspace(ws_nr, &fbwindow(), false); +} + +void SendToPrevWorkspaceCmd::real_execute() { + int ws_nr = fbwindow().screen().currentWorkspaceID() - m_workspace_num; + if ( ws_nr < 0 ) ws_nr += fbwindow().screen().getNumberOfWorkspaces(); + fbwindow().screen().sendToWorkspace(ws_nr, &fbwindow(), false); +} + +void TakeToWorkspaceCmd::real_execute() { + if (m_workspace_num >= 0 && m_workspace_num < fbwindow().screen().getNumberOfWorkspaces()) + fbwindow().screen().sendToWorkspace(m_workspace_num, &fbwindow()); +} + +void TakeToNextWorkspaceCmd::real_execute() { unsigned int workspace_num= ( fbwindow().screen().currentWorkspaceID() + m_workspace_num ) % fbwindow().screen().getNumberOfWorkspaces(); fbwindow().screen().sendToWorkspace(workspace_num, &fbwindow()); } -void SendToPrevWorkspaceCmd::real_execute() { +void TakeToPrevWorkspaceCmd::real_execute() { int workspace_num= fbwindow().screen().currentWorkspaceID() - m_workspace_num; if ( workspace_num < 0 ) workspace_num+= fbwindow().screen().getNumberOfWorkspaces(); fbwindow().screen().sendToWorkspace(workspace_num, &fbwindow());
M src/CurrentWindowCmd.hhsrc/CurrentWindowCmd.hh

@@ -96,6 +96,34 @@ private:

const int m_workspace_num; }; +class TakeToWorkspaceCmd : public WindowHelperCmd { +public: + explicit TakeToWorkspaceCmd(int workspace_num) : m_workspace_num(workspace_num) { } +protected: + void real_execute(); +private: + const int m_workspace_num; +}; + +class TakeToNextWorkspaceCmd : public WindowHelperCmd { +public: + explicit TakeToNextWorkspaceCmd(int workspace_num) : m_workspace_num(workspace_num) { } +protected: + void real_execute(); +private: + const int m_workspace_num; +}; + +class TakeToPrevWorkspaceCmd : public WindowHelperCmd { +public: + explicit TakeToPrevWorkspaceCmd(int workspace_num) : m_workspace_num(workspace_num) { } +protected: + void real_execute(); +private: + const int m_workspace_num; +}; + + // goto tab class GoToTabCmd: public WindowHelperCmd { public:
M src/FbCommandFactory.ccsrc/FbCommandFactory.cc

@@ -122,6 +122,9 @@ "showdesktop",

"stick", "stickwindow", "tab", + "taketoworkspace", + "taketonextworkspace", + "taketoprevworkspace", "toggledecor", "windowmenu", "workspace",

@@ -279,6 +282,12 @@ else if (command == "sendtonextworkspace")

return new SendToNextWorkspaceCmd(atoi(arguments.c_str())); else if (command == "sendtoprevworkspace") return new SendToPrevWorkspaceCmd(atoi(arguments.c_str())); + else if (command == "taketoworkspace") + return new TakeToWorkspaceCmd(atoi(arguments.c_str()) - 1); + else if (command == "taketonextworkspace") + return new TakeToNextWorkspaceCmd(atoi(arguments.c_str())); + else if (command == "taketoprevworkspace") + return new TakeToPrevWorkspaceCmd(atoi(arguments.c_str())); else if (command == "killwindow" || command == "kill") return new KillWindowCmd(); else if (command == "tab") {