aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnselm R Garbe2008-07-16 18:39:48 +0100
committerAnselm R Garbe2008-07-16 18:39:48 +0100
commit7ecadcee39697807c7b29221af49c67bb19ac055 (patch)
tree710fb2325ea414fde6e8e08cfe038e6b7617e1ab
parentc86ed46a1bbba0635a76d05ebeb839c7fec7f7fc (diff)
local use of xidx is useless, got rid of it, falling back to screen 0 if pointer query fails for whatever reason
-rw-r--r--dwm.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/dwm.c b/dwm.c
index f8a6ed5..34bcd99 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1558,28 +1558,25 @@ updatebar(void) {
void
updategeom(void) {
#ifdef XINERAMA
- int n;
- unsigned int xidx = 0;
+ int n, i = 0;
XineramaScreenInfo *info = NULL;
/* window area geometry */
if(XineramaIsActive(dpy)) {
info = XineramaQueryScreens(dpy, &n);
if(n > 1) {
- int di, i, x, y;
+ int di, x, y;
unsigned int dui;
Window dummy;
if(XQueryPointer(dpy, root, &dummy, &dummy, &x, &y, &di, &di, &dui))
for(i = 0; i < n; i++)
- if(INRECT(x, y, info[i].x_org, info[i].y_org, info[i].width, info[i].height)) {
- xidx = i;
+ if(INRECT(x, y, info[i].x_org, info[i].y_org, info[i].width, info[i].height))
break;
- }
}
- wx = info[xidx].x_org;
- wy = showbar && topbar ? info[xidx].y_org + bh : info[xidx].y_org;
- ww = info[xidx].width;
- wh = showbar ? info[xidx].height - bh : info[xidx].height;
+ wx = info[i].x_org;
+ wy = showbar && topbar ? info[i].y_org + bh : info[i].y_org;
+ ww = info[i].width;
+ wh = showbar ? info[i].height - bh : info[i].height;
XFree(info);
}
else