summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorarg@10ksloc.org <unknown>2006-08-02 10:43:21 +0200
committerarg@10ksloc.org <unknown>2006-08-02 10:43:21 +0200
commit52021851d1fd78970dfe63380d51b87f57d1ee1b (patch)
treed920e56d105de51643bc58eb98b1649cef23a0de /client.c
parentrenamed WM_PROTOCOL_DELWIN into PROTODELWIN (diff)
downloaddwm-52021851d1fd78970dfe63380d51b87f57d1ee1b.tar.gz
dwm-52021851d1fd78970dfe63380d51b87f57d1ee1b.zip
new resize stuff (using XConfigureWindow instead of XSendEvent)
Diffstat (limited to 'client.c')
-rw-r--r--client.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/client.c b/client.c
index 434a93b..f90a182 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 XConfigureEvent e; 274 XWindowChanges wc;
275 275
276 if(sizehints) { 276 if(sizehints) {
277 if(c->incw) 277 if(c->incw)
@@ -287,30 +287,22 @@ 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;
294 if(sticky == TopRight || sticky == BotRight) 290 if(sticky == TopRight || sticky == BotRight)
295 c->x = right - c->w; 291 c->x = right - c->w;
296 if(sticky == BotLeft || sticky == BotRight) 292 if(sticky == BotLeft || sticky == BotRight)
297 c->y = bottom - c->h; 293 c->y = bottom - c->h;
298 294
299 resizetitle(c); 295 resizetitle(c);
300 XSetWindowBorderWidth(dpy, c->win, 1); 296
301 XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); 297 if(c->tags[tsel])
302 298 wc.x = c->x;
303 e.type = ConfigureNotify; 299 else
304 e.event = c->win; 300 wc.x = c->x + 2 * sw;
305 e.window = c->win; 301 wc.y = c->y;
306 e.x = c->x; 302 wc.width = c->w;
307 e.y = c->y; 303 wc.height = c->h;
308 e.width = c->w; 304 wc.border_width = 1;
309 e.height = c->h; 305 XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
310 e.border_width = c->border;
311 e.above = None;
312 e.override_redirect = False;
313 XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&e);
314 XSync(dpy, False); 306 XSync(dpy, False);
315} 307}
316 308