mirror of git://git.suckless.org/dwm
local use of xidx is useless, got rid of it, falling back to screen 0 if pointer query fails for whatever reason
This commit is contained in:
parent
c86ed46a1b
commit
7ecadcee39
17
dwm.c
17
dwm.c
|
@ -1558,28 +1558,25 @@ updatebar(void) {
|
||||||
void
|
void
|
||||||
updategeom(void) {
|
updategeom(void) {
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
int n;
|
int n, i = 0;
|
||||||
unsigned int xidx = 0;
|
|
||||||
XineramaScreenInfo *info = NULL;
|
XineramaScreenInfo *info = NULL;
|
||||||
|
|
||||||
/* window area geometry */
|
/* window area geometry */
|
||||||
if(XineramaIsActive(dpy)) {
|
if(XineramaIsActive(dpy)) {
|
||||||
info = XineramaQueryScreens(dpy, &n);
|
info = XineramaQueryScreens(dpy, &n);
|
||||||
if(n > 1) {
|
if(n > 1) {
|
||||||
int di, i, x, y;
|
int di, x, y;
|
||||||
unsigned int dui;
|
unsigned int dui;
|
||||||
Window dummy;
|
Window dummy;
|
||||||
if(XQueryPointer(dpy, root, &dummy, &dummy, &x, &y, &di, &di, &dui))
|
if(XQueryPointer(dpy, root, &dummy, &dummy, &x, &y, &di, &di, &dui))
|
||||||
for(i = 0; i < n; i++)
|
for(i = 0; i < n; i++)
|
||||||
if(INRECT(x, y, info[i].x_org, info[i].y_org, info[i].width, info[i].height)) {
|
if(INRECT(x, y, info[i].x_org, info[i].y_org, info[i].width, info[i].height))
|
||||||
xidx = i;
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
wx = info[xidx].x_org;
|
wx = info[i].x_org;
|
||||||
wy = showbar && topbar ? info[xidx].y_org + bh : info[xidx].y_org;
|
wy = showbar && topbar ? info[i].y_org + bh : info[i].y_org;
|
||||||
ww = info[xidx].width;
|
ww = info[i].width;
|
||||||
wh = showbar ? info[xidx].height - bh : info[xidx].height;
|
wh = showbar ? info[i].height - bh : info[i].height;
|
||||||
XFree(info);
|
XFree(info);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue