added key commands :AddWorkspace and :RemoveLastWorkspace

This commit is contained in:
markt 2007-07-01 21:01:31 +00:00
parent 7783a8c84e
commit 69d63da542
4 changed files with 30 additions and 0 deletions

View file

@ -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

View file

@ -60,6 +60,7 @@ static int getint(const char *str, int defaultvalue) {
FbCommandFactory::FbCommandFactory() {
// setup commands that we can handle
const char* commands[] = {
"addworkspace",
"arrangewindows",
"bindkey",
"close",
@ -115,6 +116,7 @@ FbCommandFactory::FbCommandFactory() {
"reconfig",
"reconfigure",
"reloadstyle",
"removelastworkspace",
"resizeto",
"resize",
"resizehorizontal",
@ -232,6 +234,10 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command,
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
//

View file

@ -63,6 +63,18 @@ void DirFocusCmd::execute() {
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)

View file

@ -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) { }