diff options
Diffstat (limited to 'src/CurrentWindowCmd.cc')
-rw-r--r-- | src/CurrentWindowCmd.cc | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/src/CurrentWindowCmd.cc b/src/CurrentWindowCmd.cc index 4c027d9..9253058 100644 --- a/src/CurrentWindowCmd.cc +++ b/src/CurrentWindowCmd.cc | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "CurrentWindowCmd.hh" | 23 | #include "CurrentWindowCmd.hh" |
24 | 24 | ||
25 | #include "fluxbox.hh" | 25 | #include "fluxbox.hh" |
26 | #include "Layer.hh" | ||
26 | #include "Window.hh" | 27 | #include "Window.hh" |
27 | #include "WindowCmd.hh" | 28 | #include "WindowCmd.hh" |
28 | #include "Screen.hh" | 29 | #include "Screen.hh" |
@@ -55,8 +56,6 @@ FbTk::Command<void> *createCurrentWindowCmd(const std::string &command, | |||
55 | return new CurrentWindowCmd(&FluxboxWindow::lower); | 56 | return new CurrentWindowCmd(&FluxboxWindow::lower); |
56 | else if (command == "lowerlayer") | 57 | else if (command == "lowerlayer") |
57 | return new CurrentWindowCmd(&FluxboxWindow::lowerLayer); | 58 | return new CurrentWindowCmd(&FluxboxWindow::lowerLayer); |
58 | else if (command == "activate" || command == "focus") | ||
59 | return new CurrentWindowCmd((void (FluxboxWindow::*)())&FluxboxWindow::focus); | ||
60 | else if (command == "close") | 59 | else if (command == "close") |
61 | return new CurrentWindowCmd(&FluxboxWindow::close); | 60 | return new CurrentWindowCmd(&FluxboxWindow::close); |
62 | else if (command == "killwindow" || command == "kill") | 61 | else if (command == "killwindow" || command == "kill") |
@@ -97,8 +96,6 @@ REGISTER_COMMAND_PARSER(raise, createCurrentWindowCmd, void); | |||
97 | REGISTER_COMMAND_PARSER(raiselayer, createCurrentWindowCmd, void); | 96 | REGISTER_COMMAND_PARSER(raiselayer, createCurrentWindowCmd, void); |
98 | REGISTER_COMMAND_PARSER(lower, createCurrentWindowCmd, void); | 97 | REGISTER_COMMAND_PARSER(lower, createCurrentWindowCmd, void); |
99 | REGISTER_COMMAND_PARSER(lowerlayer, createCurrentWindowCmd, void); | 98 | REGISTER_COMMAND_PARSER(lowerlayer, createCurrentWindowCmd, void); |
100 | REGISTER_COMMAND_PARSER(activate, createCurrentWindowCmd, void); | ||
101 | REGISTER_COMMAND_PARSER(focus, createCurrentWindowCmd, void); | ||
102 | REGISTER_COMMAND_PARSER(close, createCurrentWindowCmd, void); | 99 | REGISTER_COMMAND_PARSER(close, createCurrentWindowCmd, void); |
103 | REGISTER_COMMAND_PARSER(killwindow, createCurrentWindowCmd, void); | 100 | REGISTER_COMMAND_PARSER(killwindow, createCurrentWindowCmd, void); |
104 | REGISTER_COMMAND_PARSER(kill, createCurrentWindowCmd, void); | 101 | REGISTER_COMMAND_PARSER(kill, createCurrentWindowCmd, void); |
@@ -251,6 +248,18 @@ void GoToTabCmd::real_execute() { | |||
251 | (*it)->focus(); | 248 | (*it)->focus(); |
252 | } | 249 | } |
253 | 250 | ||
251 | REGISTER_COMMAND_WITH_ARGS(activate, FocusCmd, void); | ||
252 | REGISTER_COMMAND_WITH_ARGS(focus, FocusCmd, void); | ||
253 | |||
254 | void FocusCmd::real_execute() { | ||
255 | Focusable *win = 0; | ||
256 | if (!m_pat.error()) | ||
257 | win = fbwindow().screen().focusControl().focusedOrderWinList().find(m_pat); | ||
258 | if (!win) | ||
259 | win = &fbwindow(); | ||
260 | win->focus(); | ||
261 | } | ||
262 | |||
254 | REGISTER_COMMAND(startmoving, StartMovingCmd, void); | 263 | REGISTER_COMMAND(startmoving, StartMovingCmd, void); |
255 | 264 | ||
256 | void StartMovingCmd::real_execute() { | 265 | void StartMovingCmd::real_execute() { |
@@ -479,6 +488,18 @@ void FullscreenCmd::real_execute() { | |||
479 | fbwindow().setFullscreen(!fbwindow().isFullscreen()); | 488 | fbwindow().setFullscreen(!fbwindow().isFullscreen()); |
480 | } | 489 | } |
481 | 490 | ||
491 | FbTk::Command<void> *SetLayerCmd::parse(const string &command, | ||
492 | const string &args, bool trusted) { | ||
493 | int l = Layer::getNumFromString(args); | ||
494 | return (l == -1) ? 0 : new SetLayerCmd(l); | ||
495 | } | ||
496 | |||
497 | REGISTER_COMMAND_PARSER(setlayer, SetLayerCmd::parse, void); | ||
498 | |||
499 | void SetLayerCmd::real_execute() { | ||
500 | fbwindow().moveToLayer(m_layer); | ||
501 | } | ||
502 | |||
482 | FbTk::Command<void> *SetAlphaCmd::parse(const string &command, const string &args, | 503 | FbTk::Command<void> *SetAlphaCmd::parse(const string &command, const string &args, |
483 | bool trusted) { | 504 | bool trusted) { |
484 | typedef std::vector<string> StringTokens; | 505 | typedef std::vector<string> StringTokens; |