dwm-meillo
diff client.c @ 159:a5eab6aaf859
reverting to old resize policy
author | arg@10ksloc.org |
---|---|
date | Wed, 02 Aug 2006 10:48:58 +0200 |
parents | 4e42dfc0f61f |
children | f381e34158d9 |
line diff
1.1 --- a/client.c Wed Aug 02 10:43:21 2006 +0200 1.2 +++ b/client.c Wed Aug 02 10:48:58 2006 +0200 1.3 @@ -271,7 +271,7 @@ 1.4 { 1.5 int bottom = c->y + c->h; 1.6 int right = c->x + c->w; 1.7 - XWindowChanges wc; 1.8 + XConfigureEvent e; 1.9 1.10 if(sizehints) { 1.11 if(c->incw) 1.12 @@ -287,22 +287,30 @@ 1.13 if(c->maxh && c->h > c->maxh) 1.14 c->h = c->maxh; 1.15 } 1.16 + if(c->x > sw) /* might happen on restart */ 1.17 + c->x = sw - c->w; 1.18 + if(c->y > sh) 1.19 + c->y = sh - c->h; 1.20 if(sticky == TopRight || sticky == BotRight) 1.21 c->x = right - c->w; 1.22 if(sticky == BotLeft || sticky == BotRight) 1.23 c->y = bottom - c->h; 1.24 1.25 resizetitle(c); 1.26 + XSetWindowBorderWidth(dpy, c->win, 1); 1.27 + XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); 1.28 1.29 - if(c->tags[tsel]) 1.30 - wc.x = c->x; 1.31 - else 1.32 - wc.x = c->x + 2 * sw; 1.33 - wc.y = c->y; 1.34 - wc.width = c->w; 1.35 - wc.height = c->h; 1.36 - wc.border_width = 1; 1.37 - XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); 1.38 + e.type = ConfigureNotify; 1.39 + e.event = c->win; 1.40 + e.window = c->win; 1.41 + e.x = c->x; 1.42 + e.y = c->y; 1.43 + e.width = c->w; 1.44 + e.height = c->h; 1.45 + e.border_width = c->border; 1.46 + e.above = None; 1.47 + e.override_redirect = False; 1.48 + XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&e); 1.49 XSync(dpy, False); 1.50 } 1.51