diff options
| -rw-r--r-- | client.c | 36 | ||||
| -rw-r--r-- | event.c | 7 |
2 files changed, 23 insertions, 20 deletions
| @@ -219,12 +219,13 @@ manage(Window w, XWindowAttributes *wa) | |||
| 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); |
| @@ -237,8 +238,6 @@ manage(Window w, XWindowAttributes *wa) | |||
| 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; |
| @@ -251,11 +250,12 @@ manage(Window w, XWindowAttributes *wa) | |||
| 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 | ||
| @@ -272,6 +272,7 @@ resize(Client *c, Bool sizehints, Corner sticky) | |||
| 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) |
| @@ -287,18 +288,23 @@ resize(Client *c, Bool sizehints, Corner sticky) | |||
| 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; |
| @@ -175,11 +175,8 @@ configurerequest(XEvent *e) | |||
| 175 | wc.width = ev->width; | 175 | wc.width = ev->width; |
| 176 | wc.height = ev->height; | 176 | wc.height = ev->height; |
| 177 | wc.border_width = 1; | 177 | wc.border_width = 1; |
| 178 | wc.sibling = None; | 178 | XConfigureWindow(dpy, ev->window, |
| 179 | wc.stack_mode = Above; | 179 | CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); |
| 180 | ev->value_mask &= ~CWStackMode; | ||
| 181 | ev->value_mask |= CWBorderWidth; | ||
| 182 | XConfigureWindow(dpy, ev->window, ev->value_mask, &wc); | ||
| 183 | XSync(dpy, False); | 180 | XSync(dpy, False); |
| 184 | } | 181 | } |
| 185 | 182 | ||
