Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.2 KiB

  1. void
  2. setborderpx(const Arg *arg)
  3. {
  4. Client *c;
  5. int prev_borderpx = selmon->borderpx;
  6. if (arg->i == 0)
  7. selmon->borderpx = borderpx;
  8. else if (selmon->borderpx + arg->i < 0)
  9. selmon->borderpx = 0;
  10. else
  11. selmon->borderpx += arg->i;
  12. #if BAR_BORDER_PATCH
  13. for (bar = selmon->bar; bar; bar = bar->next) {
  14. bar->bh = bar->bh - 2 * bar->borderpx + 2 * selmon->borderpx;
  15. bar->borderpx = selmon->borderpx;
  16. }
  17. updatebarpos(selmon);
  18. for (bar = selmon->bar; bar; bar = bar->next)
  19. XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
  20. #endif // BAR_BORDER_PATCH
  21. for (c = selmon->clients; c; c = c->next)
  22. {
  23. if (c->bw + arg->i < 0)
  24. c->bw = 0;
  25. else
  26. c->bw = selmon->borderpx;
  27. if (c->isfloating || !selmon->lt[selmon->sellt]->arrange)
  28. {
  29. if (arg->i != 0 && prev_borderpx + arg->i >= 0)
  30. resize(c, c->x, c->y, c->w-(arg->i*2), c->h-(arg->i*2), 0);
  31. else if (arg->i != 0)
  32. resizeclient(c, c->x, c->y, c->w, c->h);
  33. else if (prev_borderpx > borderpx)
  34. resize(c, c->x, c->y, c->w + 2*(prev_borderpx - borderpx), c->h + 2*(prev_borderpx - borderpx), 0);
  35. else if (prev_borderpx < borderpx)
  36. resize(c, c->x, c->y, c->w - 2*(borderpx - prev_borderpx), c->h - 2*(borderpx - prev_borderpx), 0);
  37. }
  38. }
  39. arrange(selmon);
  40. }