diff options
| author | coasteen <coasteen@proton.me> | 2026-07-09 10:42:28 +0330 |
|---|---|---|
| committer | coasteen <coasteen@proton.me> | 2026-07-09 10:42:28 +0330 |
| commit | 8cbadb61604667b407b53ee1258433994fa4765a (patch) | |
| tree | 97765fb29418fd6278fcb4cbb9760893afaf7a58 /dwm/patch/aspectresize.c | |
Diffstat (limited to 'dwm/patch/aspectresize.c')
| -rwxr-xr-x | dwm/patch/aspectresize.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/dwm/patch/aspectresize.c b/dwm/patch/aspectresize.c new file mode 100755 index 0000000..cdd5afd --- /dev/null +++ b/dwm/patch/aspectresize.c @@ -0,0 +1,25 @@ +void +aspectresize(const Arg *arg) +{ + /* only floating windows can be moved */ + Client *c; + c = selmon->sel; + float ratio; + int w, h,nw, nh; + + if (!c || !arg) + return; + if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) + return; + + ratio = (float)c->w / (float)c->h; + h = arg->i; + w = (int)(ratio * h); + + nw = c->w + w; + nh = c->h + h; + + XRaiseWindow(dpy, c->win); + resize(c, c->x, c->y, nw, nh, True); +} + |
