diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CurrentWindowCmd.cc | 41 | ||||
-rw-r--r-- | src/CurrentWindowCmd.hh | 7 |
2 files changed, 24 insertions, 24 deletions
diff --git a/src/CurrentWindowCmd.cc b/src/CurrentWindowCmd.cc index 3e4ef38..2ba4123 100644 --- a/src/CurrentWindowCmd.cc +++ b/src/CurrentWindowCmd.cc | |||
@@ -167,6 +167,23 @@ void CurrentWindowCmd::real_execute() { | |||
167 | (fbwindow().*m_action)(); | 167 | (fbwindow().*m_action)(); |
168 | } | 168 | } |
169 | 169 | ||
170 | void ActivateTabCmd::real_execute() { | ||
171 | Window root, last = 0, | ||
172 | tab = Fluxbox::instance()->lastEvent().xany.window; | ||
173 | int junk; unsigned int ujunk; | ||
174 | WinClient *winclient = fbwindow().winClientOfLabelButtonWindow(tab); | ||
175 | Display *dpy = Fluxbox::instance()->display(); | ||
176 | while (!winclient && tab && tab != last) { | ||
177 | last = tab; | ||
178 | XQueryPointer(dpy, tab, &root, &tab, &junk, &junk, &junk, &junk, &ujunk); | ||
179 | winclient = fbwindow().winClientOfLabelButtonWindow(tab); | ||
180 | } | ||
181 | |||
182 | if (winclient && winclient != &fbwindow().winClient()) { | ||
183 | fbwindow().setCurrentClient(*winclient, true); | ||
184 | } | ||
185 | } | ||
186 | |||
170 | namespace { | 187 | namespace { |
171 | 188 | ||
172 | FbTk::Command<void> *parseIntCmd(const string &command, const string &args, | 189 | FbTk::Command<void> *parseIntCmd(const string &command, const string &args, |
@@ -222,30 +239,6 @@ REGISTER_COMMAND_PARSER(activate, parseFocusCmd, void); | |||
222 | REGISTER_COMMAND_PARSER(focus, parseFocusCmd, void); | 239 | REGISTER_COMMAND_PARSER(focus, parseFocusCmd, void); |
223 | 240 | ||
224 | 241 | ||
225 | class ActivateTabCmd: public WindowHelperCmd { | ||
226 | public: | ||
227 | explicit ActivateTabCmd() { } | ||
228 | protected: | ||
229 | void real_execute() { | ||
230 | Window root, last = 0, | ||
231 | tab = Fluxbox::instance()->lastEvent().xany.window; | ||
232 | int junk; unsigned int ujunk; | ||
233 | WinClient *winclient = 0; | ||
234 | Display *dpy = Fluxbox::instance()->display(); | ||
235 | while (!winclient && tab && tab != last) { | ||
236 | last = tab; | ||
237 | XQueryPointer(dpy, tab, &root, &tab, &junk, &junk, &junk, &junk, &ujunk); | ||
238 | winclient = fbwindow().winClientOfLabelButtonWindow(tab); | ||
239 | } | ||
240 | |||
241 | if (winclient && winclient != &fbwindow().winClient()) { | ||
242 | fbwindow().setCurrentClient(*winclient, true); | ||
243 | } | ||
244 | |||
245 | } | ||
246 | }; | ||
247 | |||
248 | |||
249 | REGISTER_COMMAND(activatetab, ActivateTabCmd, void); | 242 | REGISTER_COMMAND(activatetab, ActivateTabCmd, void); |
250 | 243 | ||
251 | class SetXPropCmd: public WindowHelperCmd { | 244 | class SetXPropCmd: public WindowHelperCmd { |
diff --git a/src/CurrentWindowCmd.hh b/src/CurrentWindowCmd.hh index 95175f2..36f76ec 100644 --- a/src/CurrentWindowCmd.hh +++ b/src/CurrentWindowCmd.hh | |||
@@ -282,4 +282,11 @@ private: | |||
282 | ClientPattern m_pat; | 282 | ClientPattern m_pat; |
283 | }; | 283 | }; |
284 | 284 | ||
285 | class ActivateTabCmd: public WindowHelperCmd { | ||
286 | public: | ||
287 | explicit ActivateTabCmd() { } | ||
288 | protected: | ||
289 | void real_execute(); | ||
290 | }; | ||
291 | |||
285 | #endif // CURRENTWINDOWCMD_HH | 292 | #endif // CURRENTWINDOWCMD_HH |