diff options
author | Thomas Lübking <thomas.luebking@gmail.com> | 2016-07-15 14:19:27 (GMT) |
---|---|---|
committer | Thomas Lübking <thomas.luebking@gmail.com> | 2016-08-27 07:34:01 (GMT) |
commit | a1d3065994daba4bb0d1b437981afff358377bd4 (patch) | |
tree | 718fd9ed837e24a71a74fcc5bbf355686d4c9094 /src | |
parent | 8d88d9be176f255bb85b13a9719145127273467c (diff) | |
download | fluxbox-a1d3065994daba4bb0d1b437981afff358377bd4.zip fluxbox-a1d3065994daba4bb0d1b437981afff358377bd4.tar.bz2 |
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 =)
Diffstat (limited to 'src')
-rw-r--r-- | src/CurrentWindowCmd.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/CurrentWindowCmd.cc b/src/CurrentWindowCmd.cc index 44556f5..3e4ef38 100644 --- a/src/CurrentWindowCmd.cc +++ b/src/CurrentWindowCmd.cc | |||
@@ -227,8 +227,16 @@ public: | |||
227 | explicit ActivateTabCmd() { } | 227 | explicit ActivateTabCmd() { } |
228 | protected: | 228 | protected: |
229 | void real_execute() { | 229 | void real_execute() { |
230 | WinClient* winclient = fbwindow().winClientOfLabelButtonWindow( | 230 | Window root, last = 0, |
231 | Fluxbox::instance()->lastEvent().xany.window); | 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 | } | ||
232 | 240 | ||
233 | if (winclient && winclient != &fbwindow().winClient()) { | 241 | if (winclient && winclient != &fbwindow().winClient()) { |
234 | fbwindow().setCurrentClient(*winclient, true); | 242 | fbwindow().setCurrentClient(*winclient, true); |