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 =)
This commit is contained in:
parent
8d88d9be17
commit
a1d3065994
1 changed files with 10 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue