aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/CurrentWindowCmd.cc41
-rw-r--r--src/CurrentWindowCmd.hh7
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
170void 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
170namespace { 187namespace {
171 188
172FbTk::Command<void> *parseIntCmd(const string &command, const string &args, 189FbTk::Command<void> *parseIntCmd(const string &command, const string &args,
@@ -222,30 +239,6 @@ REGISTER_COMMAND_PARSER(activate, parseFocusCmd, void);
222REGISTER_COMMAND_PARSER(focus, parseFocusCmd, void); 239REGISTER_COMMAND_PARSER(focus, parseFocusCmd, void);
223 240
224 241
225class ActivateTabCmd: public WindowHelperCmd {
226public:
227 explicit ActivateTabCmd() { }
228protected:
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
249REGISTER_COMMAND(activatetab, ActivateTabCmd, void); 242REGISTER_COMMAND(activatetab, ActivateTabCmd, void);
250 243
251class SetXPropCmd: public WindowHelperCmd { 244class 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
285class ActivateTabCmd: public WindowHelperCmd {
286public:
287 explicit ActivateTabCmd() { }
288protected:
289 void real_execute();
290};
291
285#endif // CURRENTWINDOWCMD_HH 292#endif // CURRENTWINDOWCMD_HH