cleanup last commit slightly
This commit is contained in:
parent
32aceac8a1
commit
c71b186897
|
@ -86,27 +86,30 @@ resizeclient(void)
|
|||
int i = 0;
|
||||
if (parentwin == root && (info = XineramaQueryScreens(dpy, &n))) {
|
||||
XGetInputFocus(dpy, &w, &di);
|
||||
if (mon >= 0 && mon < n)
|
||||
if (mon >= 0 && mon < n) {
|
||||
i = mon;
|
||||
else if (w != root && w != PointerRoot && w != None) {
|
||||
// find top-level window containing current input focus
|
||||
} else if (w != root && w != PointerRoot && w != None) {
|
||||
do {
|
||||
if (XQueryTree(dpy, (pw = w), &dw, &w, &dws, &du) && dws)
|
||||
XFree(dws);
|
||||
} while (w != root && w != pw);
|
||||
// find xinerama screen with which the window intersects most
|
||||
if (XGetWindowAttributes(dpy, pw, &wa))
|
||||
for (j = 0; j < n; j++)
|
||||
if (XGetWindowAttributes(dpy, pw, &wa)) {
|
||||
for (j = 0; j < n; j++) {
|
||||
if ((a = INTERSECT(wa.x, wa.y, wa.width, wa.height, info[j])) > area) {
|
||||
area = a;
|
||||
i = j;
|
||||
}
|
||||
}
|
||||
// no focused window is on screen, so use pointer location instead
|
||||
if (mon < 0 && !area && XQueryPointer(dpy, root, &dw, &dw, &x, &y, &di, &di, &du))
|
||||
for (i = 0; i < n; i++)
|
||||
if (INTERSECT(x, y, 1, 1, info[i]))
|
||||
}
|
||||
|
||||
if (mon < 0 && !area && XQueryPointer(dpy, root, &dw, &dw, &x, &y, &di, &di, &du)) {
|
||||
for (i = 0; i < n; i++) {
|
||||
if (INTERSECT(x, y, 1, 1, info[i])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// calculate x/y position
|
||||
if (menuposition == 2) { // centered
|
||||
|
|
23
libs/img.c
23
libs/img.c
|
@ -374,27 +374,30 @@ resizetoimageheight(int imageheight)
|
|||
int i = 0;
|
||||
if (parentwin == root && (info = XineramaQueryScreens(dpy, &n))) {
|
||||
XGetInputFocus(dpy, &w, &di);
|
||||
if (mon >= 0 && mon < n)
|
||||
if (mon >= 0 && mon < n) {
|
||||
i = mon;
|
||||
else if (w != root && w != PointerRoot && w != None) {
|
||||
// find top-level window containing current input focus
|
||||
} else if (w != root && w != PointerRoot && w != None) {
|
||||
do {
|
||||
if (XQueryTree(dpy, (pw = w), &dw, &w, &dws, &du) && dws)
|
||||
XFree(dws);
|
||||
} while (w != root && w != pw);
|
||||
// find xinerama screen with which the window intersects most
|
||||
if (XGetWindowAttributes(dpy, pw, &wa))
|
||||
for (j = 0; j < n; j++)
|
||||
if (XGetWindowAttributes(dpy, pw, &wa)) {
|
||||
for (j = 0; j < n; j++) {
|
||||
if ((a = INTERSECT(wa.x, wa.y, wa.width, wa.height, info[j])) > area) {
|
||||
area = a;
|
||||
i = j;
|
||||
}
|
||||
}
|
||||
// no focused window is on screen, so use pointer location instead
|
||||
if (mon < 0 && !area && XQueryPointer(dpy, root, &dw, &dw, &x, &y, &di, &di, &du))
|
||||
for (i = 0; i < n; i++)
|
||||
if (INTERSECT(x, y, 1, 1, info[i]))
|
||||
}
|
||||
|
||||
if (mon < 0 && !area && XQueryPointer(dpy, root, &dw, &dw, &x, &y, &di, &di, &du)) {
|
||||
for (i = 0; i < n; i++) {
|
||||
if (INTERSECT(x, y, 1, 1, info[i])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// calculate x/y position
|
||||
if (menuposition == 2) { // centered
|
||||
|
|
Loading…
Reference in a new issue