aboutsummaryrefslogtreecommitdiff
path: root/src/CurrentWindowCmd.cc
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2016-07-15 14:19:27 (GMT)
committerThomas Lübking <thomas.luebking@gmail.com>2016-08-27 07:34:01 (GMT)
commita1d3065994daba4bb0d1b437981afff358377bd4 (patch)
tree718fd9ed837e24a71a74fcc5bbf355686d4c9094 /src/CurrentWindowCmd.cc
parent8d88d9be176f255bb85b13a9719145127273467c (diff)
downloadfluxbox-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/CurrentWindowCmd.cc')
-rw-r--r--src/CurrentWindowCmd.cc12
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() { }
228protected: 228protected:
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);