Mercurial > aewl
comparison client.c @ 163:e2e1de08341d
new stuff
author | arg@10ksloc.org |
---|---|
date | Wed, 02 Aug 2006 13:05:04 +0200 |
parents | f381e34158d9 |
children | 21071ae1fe68 |
comparison
equal
deleted
inserted
replaced
162:a6a31e485fbd | 163:e2e1de08341d |
---|---|
217 c->y = c->ty = wa->y; | 217 c->y = c->ty = wa->y; |
218 c->w = c->tw = wa->width; | 218 c->w = c->tw = wa->width; |
219 c->h = wa->height; | 219 c->h = wa->height; |
220 c->th = bh; | 220 c->th = bh; |
221 | 221 |
222 if(c->y < bh) | 222 c->border = 1; |
223 setsize(c); | |
224 | |
225 if(c->h != sh && c->y < bh) | |
223 c->y = c->ty = bh; | 226 c->y = c->ty = bh; |
224 | 227 |
225 c->border = 1; | |
226 c->proto = getproto(c->win); | 228 c->proto = getproto(c->win); |
227 setsize(c); | |
228 XSelectInput(dpy, c->win, | 229 XSelectInput(dpy, c->win, |
229 StructureNotifyMask | PropertyChangeMask | EnterWindowMask); | 230 StructureNotifyMask | PropertyChangeMask | EnterWindowMask); |
230 XGetTransientForHint(dpy, c->win, &trans); | 231 XGetTransientForHint(dpy, c->win, &trans); |
231 twa.override_redirect = 1; | 232 twa.override_redirect = 1; |
232 twa.background_pixmap = ParentRelative; | 233 twa.background_pixmap = ParentRelative; |
235 c->title = XCreateWindow(dpy, root, c->tx, c->ty, c->tw, c->th, | 236 c->title = XCreateWindow(dpy, root, c->tx, c->ty, c->tw, c->th, |
236 0, DefaultDepth(dpy, screen), CopyFromParent, | 237 0, DefaultDepth(dpy, screen), CopyFromParent, |
237 DefaultVisual(dpy, screen), | 238 DefaultVisual(dpy, screen), |
238 CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa); | 239 CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa); |
239 | 240 |
240 settags(c); | |
241 | |
242 if(clients) | 241 if(clients) |
243 clients->prev = c; | 242 clients->prev = c; |
244 c->next = clients; | 243 c->next = clients; |
245 clients = c; | 244 clients = c; |
246 | 245 |
249 XGrabButton(dpy, Button2, MODKEY, c->win, False, BUTTONMASK, | 248 XGrabButton(dpy, Button2, MODKEY, c->win, False, BUTTONMASK, |
250 GrabModeAsync, GrabModeSync, None, None); | 249 GrabModeAsync, GrabModeSync, None, None); |
251 XGrabButton(dpy, Button3, MODKEY, c->win, False, BUTTONMASK, | 250 XGrabButton(dpy, Button3, MODKEY, c->win, False, BUTTONMASK, |
252 GrabModeAsync, GrabModeSync, None, None); | 251 GrabModeAsync, GrabModeSync, None, None); |
253 | 252 |
253 settags(c); | |
254 if(!c->isfloat) | 254 if(!c->isfloat) |
255 c->isfloat = trans || (c->maxw && c->minw && | 255 c->isfloat = trans |
256 (c->maxw == c->minw) && (c->maxh == c->minh)); | 256 || (c->maxw && c->minw && |
257 | 257 c->maxw == c->minw && c->maxh == c->minh) |
258 | 258 || (c->w == sw && c->h == sh); |
259 settitle(c); | 259 settitle(c); |
260 arrange(NULL); | 260 arrange(NULL); |
261 | 261 |
262 /* mapping the window now prevents flicker */ | 262 /* mapping the window now prevents flicker */ |
263 XMapRaised(dpy, c->win); | 263 XMapRaised(dpy, c->win); |
270 resize(Client *c, Bool sizehints, Corner sticky) | 270 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 XConfigureEvent e; |
275 XWindowChanges wc; | |
275 | 276 |
276 if(sizehints) { | 277 if(sizehints) { |
277 if(c->incw) | 278 if(c->incw) |
278 c->w -= (c->w - c->basew) % c->incw; | 279 c->w -= (c->w - c->basew) % c->incw; |
279 if(c->inch) | 280 if(c->inch) |
285 if(c->maxw && c->w > c->maxw) | 286 if(c->maxw && c->w > c->maxw) |
286 c->w = c->maxw; | 287 c->w = c->maxw; |
287 if(c->maxh && c->h > c->maxh) | 288 if(c->maxh && c->h > c->maxh) |
288 c->h = c->maxh; | 289 c->h = c->maxh; |
289 } | 290 } |
290 if(c->x > sw) /* might happen on restart */ | 291 if(c->x > right) /* might happen on restart */ |
291 c->x = sw - c->w; | 292 c->x = right - c->w; |
292 if(c->y > sh) | 293 if(c->y > bottom) |
293 c->y = sh - c->h; | 294 c->y = bottom - c->h; |
294 if(sticky == TopRight || sticky == BotRight) | 295 if(sticky == TopRight || sticky == BotRight) |
295 c->x = right - c->w; | 296 c->x = right - c->w; |
296 if(sticky == BotLeft || sticky == BotRight) | 297 if(sticky == BotLeft || sticky == BotRight) |
297 c->y = bottom - c->h; | 298 c->y = bottom - c->h; |
298 | 299 |
299 resizetitle(c); | 300 resizetitle(c); |
300 XSetWindowBorderWidth(dpy, c->win, 1); | 301 wc.x = c->x; |
301 XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); | 302 wc.y = c->y; |
303 wc.width = c->w; | |
304 wc.height = c->h; | |
305 wc.border_width = 1; | |
306 XConfigureWindow(dpy, c->win, | |
307 CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); | |
302 | 308 |
303 e.type = ConfigureNotify; | 309 e.type = ConfigureNotify; |
304 e.event = c->win; | 310 e.event = c->win; |
305 e.window = c->win; | 311 e.window = c->win; |
306 e.x = c->x; | 312 e.x = c->x; |