1
0
mirror of git://git.suckless.org/dwm synced 2024-12-17 12:44:58 +00:00

reverting to old resize policy

This commit is contained in:
arg@10ksloc.org 2006-08-02 10:48:58 +02:00
parent 52021851d1
commit 57871415c1
2 changed files with 31 additions and 20 deletions

View File

@ -271,7 +271,7 @@ resize(Client *c, Bool sizehints, Corner sticky)
{
int bottom = c->y + c->h;
int right = c->x + c->w;
XWindowChanges wc;
XConfigureEvent e;
if(sizehints) {
if(c->incw)
@ -287,22 +287,30 @@ resize(Client *c, Bool sizehints, Corner sticky)
if(c->maxh && c->h > c->maxh)
c->h = c->maxh;
}
if(c->x > sw) /* might happen on restart */
c->x = sw - c->w;
if(c->y > sh)
c->y = sh - c->h;
if(sticky == TopRight || sticky == BotRight)
c->x = right - c->w;
if(sticky == BotLeft || sticky == BotRight)
c->y = bottom - c->h;
resizetitle(c);
XSetWindowBorderWidth(dpy, c->win, 1);
XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
if(c->tags[tsel])
wc.x = c->x;
else
wc.x = c->x + 2 * sw;
wc.y = c->y;
wc.width = c->w;
wc.height = c->h;
wc.border_width = 1;
XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
e.type = ConfigureNotify;
e.event = c->win;
e.window = c->win;
e.x = c->x;
e.y = c->y;
e.width = c->w;
e.height = c->h;
e.border_width = c->border;
e.above = None;
e.override_redirect = False;
XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&e);
XSync(dpy, False);
}

23
event.c
View File

@ -153,6 +153,7 @@ configurerequest(XEvent *e)
XConfigureRequestEvent *ev = &e->xconfigurerequest;
XWindowChanges wc;
ev->value_mask &= ~CWSibling;
if((c = getclient(ev->window))) {
gravitate(c, True);
if(ev->value_mask & CWX)
@ -168,16 +169,18 @@ configurerequest(XEvent *e)
gravitate(c, False);
resize(c, True, TopLeft);
}
else {
wc.x = ev->x;
wc.y = ev->y;
wc.width = ev->width;
wc.height = ev->height;
wc.border_width = 1;
XConfigureWindow(dpy, ev->window,
CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
XSync(dpy, False);
}
wc.x = ev->x;
wc.y = ev->y;
wc.width = ev->width;
wc.height = ev->height;
wc.border_width = 1;
wc.sibling = None;
wc.stack_mode = Above;
ev->value_mask &= ~CWStackMode;
ev->value_mask |= CWBorderWidth;
XConfigureWindow(dpy, ev->window, ev->value_mask, &wc);
XSync(dpy, False);
}
static void