summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/CurrentWindowCmd.cc25
-rw-r--r--src/CurrentWindowCmd.hh10
2 files changed, 13 insertions, 22 deletions
diff --git a/src/CurrentWindowCmd.cc b/src/CurrentWindowCmd.cc
index 28d7ecd..bfccbdc 100644
--- a/src/CurrentWindowCmd.cc
+++ b/src/CurrentWindowCmd.cc
@@ -189,6 +189,19 @@ REGISTER_COMMAND_PARSER(taketoprevworkspace, parseIntCmd, void);
189REGISTER_COMMAND_PARSER(sendtoworkspace, parseIntCmd, void); 189REGISTER_COMMAND_PARSER(sendtoworkspace, parseIntCmd, void);
190REGISTER_COMMAND_PARSER(taketoworkspace, parseIntCmd, void); 190REGISTER_COMMAND_PARSER(taketoworkspace, parseIntCmd, void);
191 191
192FbTk::Command<void> *parseFocusCmd(const string &command, const string &args,
193 bool trusted) {
194 ClientPattern pat(args.c_str());
195 if (!pat.error())
196 return FbTk::CommandParser<void>::instance().parse("GoToWindow 1 " +
197 args);
198 return new CurrentWindowCmd((CurrentWindowCmd::Action)
199 &FluxboxWindow::focus);
200}
201
202REGISTER_COMMAND_PARSER(activate, parseFocusCmd, void);
203REGISTER_COMMAND_PARSER(focus, parseFocusCmd, void);
204
192}; // end anonymous namespace 205}; // end anonymous namespace
193 206
194void SetHeadCmd::real_execute() { 207void SetHeadCmd::real_execute() {
@@ -250,18 +263,6 @@ void GoToTabCmd::real_execute() {
250 (*it)->focus(); 263 (*it)->focus();
251} 264}
252 265
253REGISTER_COMMAND_WITH_ARGS(activate, FocusCmd, void);
254REGISTER_COMMAND_WITH_ARGS(focus, FocusCmd, void);
255
256void FocusCmd::real_execute() {
257 Focusable *win = 0;
258 if (!m_pat.error())
259 win = fbwindow().screen().focusControl().focusedOrderWinList().find(m_pat);
260 if (!win)
261 win = &fbwindow();
262 win->focus();
263}
264
265REGISTER_COMMAND(startmoving, StartMovingCmd, void); 266REGISTER_COMMAND(startmoving, StartMovingCmd, void);
266 267
267void StartMovingCmd::real_execute() { 268void StartMovingCmd::real_execute() {
diff --git a/src/CurrentWindowCmd.hh b/src/CurrentWindowCmd.hh
index 2d33847..8371204 100644
--- a/src/CurrentWindowCmd.hh
+++ b/src/CurrentWindowCmd.hh
@@ -137,16 +137,6 @@ private:
137 const int m_tab_num; 137 const int m_tab_num;
138}; 138};
139 139
140// focus the window
141class FocusCmd: public WindowHelperCmd {
142public:
143 explicit FocusCmd(const std::string &pat): m_pat(pat.c_str()) { }
144protected:
145 void real_execute();
146private:
147 const ClientPattern m_pat;
148};
149
150// begin moving with mouse 140// begin moving with mouse
151class StartMovingCmd: public WindowHelperCmd { 141class StartMovingCmd: public WindowHelperCmd {
152public: 142public: