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