aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-08-18 22:20:16 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-08-18 22:20:16 (GMT)
commit18ae02875fbe67b375bbc5a8d3ac84771d0767c1 (patch)
treee5de3f22cce6b2376ddb712577b7d616d79ec045 /src
parentccba298cb59e2d2dbd2235188e0695fff62c4799 (diff)
downloadfluxbox_pavel-18ae02875fbe67b375bbc5a8d3ac84771d0767c1.zip
fluxbox_pavel-18ae02875fbe67b375bbc5a8d3ac84771d0767c1.tar.bz2
fix :Focus <pattern> when all windows are minimized
Diffstat (limited to 'src')
-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: