diff options
Diffstat (limited to 'client.c')
| -rw-r--r-- | client.c | 53 |
1 files changed, 38 insertions, 15 deletions
| @@ -70,6 +70,9 @@ focusnext(Arg *arg) | |||
| 70 | if(!sel) | 70 | if(!sel) |
| 71 | return; | 71 | return; |
| 72 | 72 | ||
| 73 | if(sel->ismax) | ||
| 74 | togglemax(NULL); | ||
| 75 | |||
| 73 | if(!(c = getnext(sel->next, tsel))) | 76 | if(!(c = getnext(sel->next, tsel))) |
| 74 | c = getnext(clients, tsel); | 77 | c = getnext(clients, tsel); |
| 75 | if(c) { | 78 | if(c) { |
| @@ -87,6 +90,9 @@ focusprev(Arg *arg) | |||
| 87 | if(!sel) | 90 | if(!sel) |
| 88 | return; | 91 | return; |
| 89 | 92 | ||
| 93 | if(sel->ismax) | ||
| 94 | togglemax(NULL); | ||
| 95 | |||
| 90 | if((c = sel->revert && sel->revert->tags[tsel] ? sel->revert : NULL)) { | 96 | if((c = sel->revert && sel->revert->tags[tsel] ? sel->revert : NULL)) { |
| 91 | higher(c); | 97 | higher(c); |
| 92 | focus(c); | 98 | focus(c); |
| @@ -234,8 +240,6 @@ manage(Window w, XWindowAttributes *wa) | |||
| 234 | c->next = clients; | 240 | c->next = clients; |
| 235 | clients = c; | 241 | clients = c; |
| 236 | 242 | ||
| 237 | XGrabButton(dpy, Button1, ControlMask, c->win, False, ButtonPressMask, | ||
| 238 | GrabModeAsync, GrabModeSync, None, None); | ||
| 239 | XGrabButton(dpy, Button1, MODKEY, c->win, False, ButtonPressMask, | 243 | XGrabButton(dpy, Button1, MODKEY, c->win, False, ButtonPressMask, |
| 240 | GrabModeAsync, GrabModeSync, None, None); | 244 | GrabModeAsync, GrabModeSync, None, None); |
| 241 | XGrabButton(dpy, Button2, MODKEY, c->win, False, ButtonPressMask, | 245 | XGrabButton(dpy, Button2, MODKEY, c->win, False, ButtonPressMask, |
| @@ -264,19 +268,6 @@ manage(Window w, XWindowAttributes *wa) | |||
| 264 | } | 268 | } |
| 265 | 269 | ||
| 266 | void | 270 | void |
| 267 | maximize(Arg *arg) | ||
| 268 | { | ||
| 269 | if(!sel) | ||
| 270 | return; | ||
| 271 | sel->x = sx; | ||
| 272 | sel->y = sy + bh; | ||
| 273 | sel->w = sw - 2 * sel->border; | ||
| 274 | sel->h = sh - 2 * sel->border - bh; | ||
| 275 | higher(sel); | ||
| 276 | resize(sel, False, TopLeft); | ||
| 277 | } | ||
| 278 | |||
| 279 | void | ||
| 280 | pop(Client *c) | 271 | pop(Client *c) |
| 281 | { | 272 | { |
| 282 | Client **l; | 273 | Client **l; |
| @@ -405,6 +396,38 @@ settitle(Client *c) | |||
| 405 | } | 396 | } |
| 406 | 397 | ||
| 407 | void | 398 | void |
| 399 | togglemax(Arg *arg) | ||
| 400 | { | ||
| 401 | int ox, oy, ow, oh; | ||
| 402 | XEvent ev; | ||
| 403 | |||
| 404 | if(!sel) | ||
| 405 | return; | ||
| 406 | |||
| 407 | if((sel->ismax = !sel->ismax)) { | ||
| 408 | ox = sel->x; | ||
| 409 | oy = sel->y; | ||
| 410 | ow = sel->w; | ||
| 411 | oh = sel->h; | ||
| 412 | sel->x = sx; | ||
| 413 | sel->y = sy + bh; | ||
| 414 | sel->w = sw - 2 * sel->border; | ||
| 415 | sel->h = sh - 2 * sel->border - bh; | ||
| 416 | |||
| 417 | higher(sel); | ||
| 418 | resize(sel, False, TopLeft); | ||
| 419 | |||
| 420 | sel->x = ox; | ||
| 421 | sel->y = oy; | ||
| 422 | sel->w = ow; | ||
| 423 | sel->h = oh; | ||
| 424 | } | ||
| 425 | else | ||
| 426 | resize(sel, False, TopLeft); | ||
| 427 | while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); | ||
| 428 | } | ||
| 429 | |||
| 430 | void | ||
| 408 | unmanage(Client *c) | 431 | unmanage(Client *c) |
| 409 | { | 432 | { |
| 410 | Client **l; | 433 | Client **l; |
