commit 21c5111a0c0bdd437320f1c0e1507705f41c81e0
parent 8a6042e52adc2203be3b39bc4f3c04fb42547f8e
Author: Pascal Wittmann <mail@pascal-wittmann.de>
Date: Tue, 2 Aug 2011 23:36:56 +0200
added 'follow input focus' patch for dmenu
Diffstat:
2 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/tools.suckless.org/dmenu/patches/dmenu-4.4-follow-focus.diff b/tools.suckless.org/dmenu/patches/dmenu-4.4-follow-focus.diff
@@ -0,0 +1,21 @@
+diff -r f6b31468f983 dmenu.c
+--- a/dmenu.c Sun Jul 24 20:04:58 2011 +0100
++++ b/dmenu.c Tue Aug 02 23:22:00 2011 +0200
+@@ -492,11 +492,14 @@
+ mh = (lines + 1) * bh;
+ #ifdef XINERAMA
+ if((info = XineramaQueryScreens(dc->dpy, &n))) {
+- int i, di;
+- unsigned int du;
++ int i, revert;
+ Window dw;
++ XWindowAttributes wa;
++ Window chi;
+
+- XQueryPointer(dc->dpy, root, &dw, &dw, &x, &y, &di, &di, &du);
++ XGetInputFocus(dc->dpy, &dw, &revert);
++ XGetWindowAttributes(dc->dpy, dw, &wa);
++ XTranslateCoordinates(dc->dpy, wa.root, wa.root, wa.x, wa.y, &x, &y, &chi);
+ for(i = 0; i < n-1; i++)
+ if(INRECT(x, y, info[i].x_org, info[i].y_org, info[i].width, info[i].height))
+ break;
diff --git a/tools.suckless.org/dmenu/patches/follow-focus.md b/tools.suckless.org/dmenu/patches/follow-focus.md
@@ -0,0 +1,12 @@
+FOLLOW INPUT FOCUS
+==================
+
+With this patch dmenu will show up on the monitor which has input focus.
+
+Download
+--------
+* [dmenu-4.4-follow-focus.diff](dmenu-4.4-follow-focus.diff)
+
+Author
+------
+* Pascal Wittmann - <mail@pascal-wittmann.de>