all repos — fluxbox @ 69d63da5420965216f2cd6a756301c70f6c32284

custom fork of the fluxbox windowmanager

added key commands :AddWorkspace and :RemoveLastWorkspace
markt markt
commit

69d63da5420965216f2cd6a756301c70f6c32284

parent

7783a8c84e57c4a58d270b9722800a031f50ed62

4 files changed, 30 insertions(+), 0 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,6 +1,8 @@

(Format: Year/Month/Day) Changes for 1.0.0: *07/07/01: + * Added keycommands :AddWorkspace and :RemoveLastWorkspace (Mark) + WorkspaceCmd.cc/hh FbCommandFactory.cc * More fixes for _NET_WM_STATE_MODAL and _NET_WM_STATE_DEMANDS_ATTENTION, plus a minor fix for pixmap styles (Mark) Ewmh.cc Window.cc AttentionNoticeHandler.cc/hh WinClient.cc
M src/FbCommandFactory.ccsrc/FbCommandFactory.cc

@@ -60,6 +60,7 @@

FbCommandFactory::FbCommandFactory() { // setup commands that we can handle const char* commands[] = { + "addworkspace", "arrangewindows", "bindkey", "close",

@@ -115,6 +116,7 @@ "raiselayer",

"reconfig", "reconfigure", "reloadstyle", + "removelastworkspace", "resizeto", "resize", "resizehorizontal",

@@ -232,6 +234,10 @@ name = name.substr(0, pos);

return new SetResourceValueCmd(name, value); } else if (command == "setresourcevaluedialog") return new SetResourceValueDialogCmd(); + else if (command == "addworkspace") + return new AddWorkspaceCmd(); + else if (command == "removelastworkspace") + return new RemoveLastWorkspaceCmd(); // // Current focused window commands //
M src/WorkspaceCmd.ccsrc/WorkspaceCmd.cc

@@ -63,6 +63,18 @@ if (win)

screen->focusControl().dirFocus(*win, m_dir); } +void AddWorkspaceCmd::execute() { + BScreen *screen = Fluxbox::instance()->mouseScreen(); + if (screen != 0) + screen->addWorkspace(); +} + +void RemoveLastWorkspaceCmd::execute() { + BScreen *screen = Fluxbox::instance()->mouseScreen(); + if (screen != 0) + screen->removeLastWorkspace(); +} + void NextWorkspaceCmd::execute() { BScreen *screen = Fluxbox::instance()->mouseScreen(); if (screen != 0)
M src/WorkspaceCmd.hhsrc/WorkspaceCmd.hh

@@ -53,6 +53,16 @@ private:

const FocusControl::FocusDir m_dir; }; +class AddWorkspaceCmd: public FbTk::Command { +public: + void execute(); +}; + +class RemoveLastWorkspaceCmd: public FbTk::Command { +public: + void execute(); +}; + class NextWorkspaceCmd: public FbTk::Command { public: explicit NextWorkspaceCmd(int option):m_option(option) { }