Search actual tab under mouse The feature suggests to behave like this bug actually only supported mouse clicks (because the latest event window needed to be the tab) This condition will break with two future patches (OnTitlebar context selection and Sync Pointer grabbing) so the code to determine the tab client needs to be a bit more sophisticated and, as a bonus, keyboard shortcuts to activate the tab under the pointer will work as well =)
Thomas Lübking thomas.luebking@gmail.com
1 files changed,
10 insertions(+),
2 deletions(-)
jump to
M
src/CurrentWindowCmd.cc
→
src/CurrentWindowCmd.cc
@@ -227,8 +227,16 @@ public:
explicit ActivateTabCmd() { } protected: void real_execute() { - WinClient* winclient = fbwindow().winClientOfLabelButtonWindow( - Fluxbox::instance()->lastEvent().xany.window); + Window root, last = 0, + tab = Fluxbox::instance()->lastEvent().xany.window; + int junk; unsigned int ujunk; + WinClient *winclient = 0; + Display *dpy = Fluxbox::instance()->display(); + while (!winclient && tab && tab != last) { + last = tab; + XQueryPointer(dpy, tab, &root, &tab, &junk, &junk, &junk, &junk, &ujunk); + winclient = fbwindow().winClientOfLabelButtonWindow(tab); + } if (winclient && winclient != &fbwindow().winClient()) { fbwindow().setCurrentClient(*winclient, true);