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.

23 lines
411 B

  1. void
  2. aspectresize(const Arg *arg)
  3. {
  4. /* only floating windows can be moved */
  5. Client *c;
  6. c = selmon->sel;
  7. float ratio;
  8. int w, h,nw, nh;
  9. if (!c || !arg)
  10. return;
  11. if (selmon->lt[selmon->sellt]->arrange && !c->isfloating)
  12. return;
  13. ratio = (float)c->w / (float)c->h;
  14. h = arg->i;
  15. w = (int)(ratio * h);
  16. nw = c->w + w;
  17. nh = c->h + h;
  18. XRaiseWindow(dpy, c->win);
  19. resize(c, c->x, c->y, nw, nh, True);
  20. }