aewl
changeset 159:a5eab6aaf859
reverting to old resize policy
author | arg@10ksloc.org |
---|---|
date | Wed, 02 Aug 2006 10:48:58 +0200 |
parents | 4e42dfc0f61f |
children | c8db0a825775 |
files | client.c event.c |
diffstat | 2 files changed, 31 insertions(+), 20 deletions(-) [+] |
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
2.1 --- a/event.c Wed Aug 02 10:43:21 2006 +0200 2.2 +++ b/event.c Wed Aug 02 10:48:58 2006 +0200 2.3 @@ -153,6 +153,7 @@ 2.4 XConfigureRequestEvent *ev = &e->xconfigurerequest; 2.5 XWindowChanges wc; 2.6 2.7 + ev->value_mask &= ~CWSibling; 2.8 if((c = getclient(ev->window))) { 2.9 gravitate(c, True); 2.10 if(ev->value_mask & CWX) 2.11 @@ -168,16 +169,18 @@ 2.12 gravitate(c, False); 2.13 resize(c, True, TopLeft); 2.14 } 2.15 - else { 2.16 - wc.x = ev->x; 2.17 - wc.y = ev->y; 2.18 - wc.width = ev->width; 2.19 - wc.height = ev->height; 2.20 - wc.border_width = 1; 2.21 - XConfigureWindow(dpy, ev->window, 2.22 - CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); 2.23 - XSync(dpy, False); 2.24 - } 2.25 + 2.26 + wc.x = ev->x; 2.27 + wc.y = ev->y; 2.28 + wc.width = ev->width; 2.29 + wc.height = ev->height; 2.30 + wc.border_width = 1; 2.31 + wc.sibling = None; 2.32 + wc.stack_mode = Above; 2.33 + ev->value_mask &= ~CWStackMode; 2.34 + ev->value_mask |= CWBorderWidth; 2.35 + XConfigureWindow(dpy, ev->window, ev->value_mask, &wc); 2.36 + XSync(dpy, False); 2.37 } 2.38 2.39 static void