some other fixes, resize contains a minor bug
This commit is contained in:
parent
8e0f8ffcc6
commit
de5b294edc
16
dwm.c
16
dwm.c
@ -1276,7 +1276,6 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
|
|||||||
XWindowChanges wc;
|
XWindowChanges wc;
|
||||||
|
|
||||||
m = c->monitor;
|
m = c->monitor;
|
||||||
|
|
||||||
if(sizehints) {
|
if(sizehints) {
|
||||||
/* set minimum possible */
|
/* set minimum possible */
|
||||||
if (w < 1)
|
if (w < 1)
|
||||||
@ -1325,6 +1324,7 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
|
|||||||
x = m->sx;
|
x = m->sx;
|
||||||
if(y + h + 2 * c->border < m->sy)
|
if(y + h + 2 * c->border < m->sy)
|
||||||
y = m->sy;
|
y = m->sy;
|
||||||
|
fprintf(stderr, "resize %d %d %d %d (%d %d %d %d)\n", x, y , w, h, m->sx, m->sy, m->sw, m->sh);
|
||||||
if(c->x != x || c->y != y || c->w != w || c->h != h) {
|
if(c->x != x || c->y != y || c->w != w || c->h != h) {
|
||||||
c->x = wc.x = x;
|
c->x = wc.x = x;
|
||||||
c->y = wc.y = y;
|
c->y = wc.y = y;
|
||||||
@ -1605,7 +1605,7 @@ setup(void) {
|
|||||||
m = &monitors[i];
|
m = &monitors[i];
|
||||||
m->id = i;
|
m->id = i;
|
||||||
|
|
||||||
if (mcount != 1 && isxinerama) {
|
if(mcount != 1 && isxinerama) {
|
||||||
m->sx = info[i].x_org;
|
m->sx = info[i].x_org;
|
||||||
m->sy = info[i].y_org;
|
m->sy = info[i].y_org;
|
||||||
m->sw = info[i].width;
|
m->sw = info[i].width;
|
||||||
@ -1727,9 +1727,9 @@ tile(Monitor *m) {
|
|||||||
Client *c, *mc;
|
Client *c, *mc;
|
||||||
|
|
||||||
domwfact = dozoom = True;
|
domwfact = dozoom = True;
|
||||||
|
nx = m->wax;
|
||||||
nx = ny = nw = 0; /* gcc stupidity requires this */
|
ny = m->way;
|
||||||
|
nw = 0;
|
||||||
for(n = 0, c = nexttiled(clients, m); c; c = nexttiled(c->next, m))
|
for(n = 0, c = nexttiled(clients, m); c; c = nexttiled(c->next, m))
|
||||||
n++;
|
n++;
|
||||||
|
|
||||||
@ -1757,16 +1757,17 @@ tile(Monitor *m) {
|
|||||||
else
|
else
|
||||||
nh = th - 2 * c->border;
|
nh = th - 2 * c->border;
|
||||||
}
|
}
|
||||||
|
fprintf(stderr, "tile %d %d %d %d\n", nx, ny, nw, nh);
|
||||||
resize(c, nx, ny, nw, nh, RESIZEHINTS);
|
resize(c, nx, ny, nw, nh, RESIZEHINTS);
|
||||||
if((RESIZEHINTS) && ((c->h < bh) || (c->h > nh) || (c->w < bh) || (c->w > nw)))
|
if((RESIZEHINTS) && ((c->h < bh) || (c->h > nh) || (c->w < bh) || (c->w > nw)))
|
||||||
/* client doesn't accept size constraints */
|
/* client doesn't accept size constraints */
|
||||||
resize(c, nx, ny, nw, nh, False);
|
resize(c, nx, ny, nw, nh, False);
|
||||||
if(n > 1 && th != m->wah)
|
if(n > 1 && th != m->wah)
|
||||||
ny = c->y + c->h + 2 * c->border;
|
ny = c->y + c->h + 2 * c->border;
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
togglebar(const char *arg) {
|
togglebar(const char *arg) {
|
||||||
if(bpos == BarOff)
|
if(bpos == BarOff)
|
||||||
@ -1824,6 +1825,7 @@ unban(Client *c) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
unmanage(Client *c) {
|
unmanage(Client *c) {
|
||||||
|
Monitor *m = c->monitor;
|
||||||
XWindowChanges wc;
|
XWindowChanges wc;
|
||||||
|
|
||||||
wc.border_width = c->oldborder;
|
wc.border_width = c->oldborder;
|
||||||
@ -1842,7 +1844,7 @@ unmanage(Client *c) {
|
|||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
XSetErrorHandler(xerror);
|
XSetErrorHandler(xerror);
|
||||||
XUngrabServer(dpy);
|
XUngrabServer(dpy);
|
||||||
arrange(NULL);
|
arrange(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user