diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-08-18 22:20:16 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-08-18 22:20:16 (GMT) |
commit | 18ae02875fbe67b375bbc5a8d3ac84771d0767c1 (patch) | |
tree | e5de3f22cce6b2376ddb712577b7d616d79ec045 | |
parent | ccba298cb59e2d2dbd2235188e0695fff62c4799 (diff) | |
download | fluxbox_paul-18ae02875fbe67b375bbc5a8d3ac84771d0767c1.zip fluxbox_paul-18ae02875fbe67b375bbc5a8d3ac84771d0767c1.tar.bz2 |
fix :Focus <pattern> when all windows are minimized
-rw-r--r-- | src/CurrentWindowCmd.cc | 25 | ||||
-rw-r--r-- | src/CurrentWindowCmd.hh | 10 |
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); | |||
189 | REGISTER_COMMAND_PARSER(sendtoworkspace, parseIntCmd, void); | 189 | REGISTER_COMMAND_PARSER(sendtoworkspace, parseIntCmd, void); |
190 | REGISTER_COMMAND_PARSER(taketoworkspace, parseIntCmd, void); | 190 | REGISTER_COMMAND_PARSER(taketoworkspace, parseIntCmd, void); |
191 | 191 | ||
192 | FbTk::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 | |||
202 | REGISTER_COMMAND_PARSER(activate, parseFocusCmd, void); | ||
203 | REGISTER_COMMAND_PARSER(focus, parseFocusCmd, void); | ||
204 | |||
192 | }; // end anonymous namespace | 205 | }; // end anonymous namespace |
193 | 206 | ||
194 | void SetHeadCmd::real_execute() { | 207 | void SetHeadCmd::real_execute() { |
@@ -250,18 +263,6 @@ void GoToTabCmd::real_execute() { | |||
250 | (*it)->focus(); | 263 | (*it)->focus(); |
251 | } | 264 | } |
252 | 265 | ||
253 | REGISTER_COMMAND_WITH_ARGS(activate, FocusCmd, void); | ||
254 | REGISTER_COMMAND_WITH_ARGS(focus, FocusCmd, void); | ||
255 | |||
256 | void 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 | |||
265 | REGISTER_COMMAND(startmoving, StartMovingCmd, void); | 266 | REGISTER_COMMAND(startmoving, StartMovingCmd, void); |
266 | 267 | ||
267 | void StartMovingCmd::real_execute() { | 268 | void 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 | ||
141 | class FocusCmd: public WindowHelperCmd { | ||
142 | public: | ||
143 | explicit FocusCmd(const std::string &pat): m_pat(pat.c_str()) { } | ||
144 | protected: | ||
145 | void real_execute(); | ||
146 | private: | ||
147 | const ClientPattern m_pat; | ||
148 | }; | ||
149 | |||
150 | // begin moving with mouse | 140 | // begin moving with mouse |
151 | class StartMovingCmd: public WindowHelperCmd { | 141 | class StartMovingCmd: public WindowHelperCmd { |
152 | public: | 142 | public: |