diff options
| author | bakkeby <[email protected]> | 2020-05-21 19:58:11 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2020-05-21 19:58:11 +0200 |
| commit | fc8434abd1218fc33a4418bcde31cef10c12ede7 (patch) | |
| tree | 86b9dea5214acf443bb1da120ced4b6efe7ae411 /patch/moveplace.c | |
| parent | 2cb3e697e41c09059dbff9ec903875a95d019a7f (diff) | |
| download | dwm-flexipatch-fc8434abd1218fc33a4418bcde31cef10c12ede7.tar.gz dwm-flexipatch-fc8434abd1218fc33a4418bcde31cef10c12ede7.zip | |
Adding moveplace patch
Diffstat (limited to 'patch/moveplace.c')
| -rw-r--r-- | patch/moveplace.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/patch/moveplace.c b/patch/moveplace.c new file mode 100644 index 0000000..fb9c099 --- /dev/null +++ b/patch/moveplace.c @@ -0,0 +1,29 @@ +void +moveplace(const Arg *arg) +{ + Client *c; + int nh, nw, nx, ny; + c = selmon->sel; + if (!c || (arg->ui >= 9)) + return; + if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) + togglefloating(NULL); + nh = (selmon->wh / 3) - (c->bw * 2); + nw = (selmon->ww / 3) - (c->bw * 2); + nx = (arg->ui % 3) -1; + ny = (arg->ui / 3) -1; + if (nx < 0) + nx = selmon->wx; + else if(nx > 0) + nx = selmon->wx + selmon->ww - nw - c->bw*2; + else + nx = selmon->wx + selmon->ww/2 - nw/2 - c->bw; + if (ny <0) + ny = selmon->wy; + else if(ny > 0) + ny = selmon->wy + selmon->wh - nh - c->bw*2; + else + ny = selmon->wy + selmon->wh/2 - nh/2 - c->bw; + resize(c, nx, ny, nw, nh, True); + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, nw/2, nh/2); +}
\ No newline at end of file |
