aboutsummaryrefslogtreecommitdiff
path: root/src/CurrentWindowCmd.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/CurrentWindowCmd.cc')
-rw-r--r--src/CurrentWindowCmd.cc29
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);
97REGISTER_COMMAND_PARSER(raiselayer, createCurrentWindowCmd, void); 96REGISTER_COMMAND_PARSER(raiselayer, createCurrentWindowCmd, void);
98REGISTER_COMMAND_PARSER(lower, createCurrentWindowCmd, void); 97REGISTER_COMMAND_PARSER(lower, createCurrentWindowCmd, void);
99REGISTER_COMMAND_PARSER(lowerlayer, createCurrentWindowCmd, void); 98REGISTER_COMMAND_PARSER(lowerlayer, createCurrentWindowCmd, void);
100REGISTER_COMMAND_PARSER(activate, createCurrentWindowCmd, void);
101REGISTER_COMMAND_PARSER(focus, createCurrentWindowCmd, void);
102REGISTER_COMMAND_PARSER(close, createCurrentWindowCmd, void); 99REGISTER_COMMAND_PARSER(close, createCurrentWindowCmd, void);
103REGISTER_COMMAND_PARSER(killwindow, createCurrentWindowCmd, void); 100REGISTER_COMMAND_PARSER(killwindow, createCurrentWindowCmd, void);
104REGISTER_COMMAND_PARSER(kill, createCurrentWindowCmd, void); 101REGISTER_COMMAND_PARSER(kill, createCurrentWindowCmd, void);
@@ -251,6 +248,18 @@ void GoToTabCmd::real_execute() {
251 (*it)->focus(); 248 (*it)->focus();
252} 249}
253 250
251REGISTER_COMMAND_WITH_ARGS(activate, FocusCmd, void);
252REGISTER_COMMAND_WITH_ARGS(focus, FocusCmd, void);
253
254void 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
254REGISTER_COMMAND(startmoving, StartMovingCmd, void); 263REGISTER_COMMAND(startmoving, StartMovingCmd, void);
255 264
256void StartMovingCmd::real_execute() { 265void 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
491FbTk::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
497REGISTER_COMMAND_PARSER(setlayer, SetLayerCmd::parse, void);
498
499void SetLayerCmd::real_execute() {
500 fbwindow().moveToLayer(m_layer);
501}
502
482FbTk::Command<void> *SetAlphaCmd::parse(const string &command, const string &args, 503FbTk::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;