summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorarg@10ksloc.org <unknown>2006-08-02 10:48:58 +0200
committerarg@10ksloc.org <unknown>2006-08-02 10:48:58 +0200
commit57871415c16664cce494b68dd3e985bcb32942c5 (patch)
tree1d0574e3a5cdf6fecc145dc65db5061e7c19b7d3 /client.c
parentnew resize stuff (using XConfigureWindow instead of XSendEvent) (diff)
downloaddwm-57871415c16664cce494b68dd3e985bcb32942c5.tar.gz
dwm-57871415c16664cce494b68dd3e985bcb32942c5.zip
reverting to old resize policy
Diffstat (limited to '')
-rw-r--r--client.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/client.c b/client.c
index f90a182..434a93b 100644
--- a/client.c
+++ b/client.c
@@ -271,7 +271,7 @@ resize(Client *c, Bool sizehints, Corner sticky)
271{ 271{
272 int bottom = c->y + c->h; 272 int bottom = c->y + c->h;
273 int right = c->x + c->w; 273 int right = c->x + c->w;
274 XWindowChanges wc; 274 XConfigureEvent e;
275 275
276 if(sizehints) { 276 if(sizehints) {
277 if(c->incw) 277 if(c->incw)
@@ -287,22 +287,30 @@ resize(Client *c, Bool sizehints, Corner sticky)
287 if(c->maxh && c->h > c->maxh) 287 if(c->maxh && c->h > c->maxh)
288 c->h = c->maxh; 288 c->h = c->maxh;
289 } 289 }
290 if(c->x > sw) /* might happen on restart */
291 c->x = sw - c->w;
292 if(c->y > sh)
293 c->y = sh - c->h;
290 if(sticky == TopRight || sticky == BotRight) 294 if(sticky == TopRight || sticky == BotRight)
291 c->x = right - c->w; 295 c->x = right - c->w;
292 if(sticky == BotLeft || sticky == BotRight) 296 if(sticky == BotLeft || sticky == BotRight)
293 c->y = bottom - c->h; 297 c->y = bottom - c->h;
294 298
295 resizetitle(c); 299 resizetitle(c);
296 300 XSetWindowBorderWidth(dpy, c->win, 1);
297 if(c->tags[tsel]) 301 XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
298 wc.x = c->x; 302
299 else 303 e.type = ConfigureNotify;
300 wc.x = c->x + 2 * sw; 304 e.event = c->win;
301 wc.y = c->y; 305 e.window = c->win;
302 wc.width = c->w; 306 e.x = c->x;
303 wc.height = c->h; 307 e.y = c->y;
304 wc.border_width = 1; 308 e.width = c->w;
305 XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); 309 e.height = c->h;
310 e.border_width = c->border;
311 e.above = None;
312 e.override_redirect = False;
313 XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&e);
306 XSync(dpy, False); 314 XSync(dpy, False);
307} 315}
308 316