diff options
| author | Naz <ndpm13@ch-naseem.com> | 2026-01-20 12:23:31 +0100 |
|---|---|---|
| committer | Naz <ndpm13@ch-naseem.com> | 2026-01-20 12:23:31 +0100 |
| commit | 1683695e053e6bfd5b33a7936f1175db3d20a1f1 (patch) | |
| tree | 3736febe97dc86c6b4ed9fa292801389038dc5f9 /dwm.c | |
| parent | 90ec5b0093870639727d62b51d1d38904f9944a0 (diff) | |
feat(patch): apply dwm-push_no_master-6.4
Diffstat (limited to 'dwm.c')
| -rw-r--r-- | dwm.c | 44 |
1 files changed, 44 insertions, 0 deletions
@@ -202,7 +202,10 @@ static void motionnotify(XEvent *e); static void movemouse(const Arg *arg); static Client *nexttiled(Client *c); static void pop(Client *c); +static Client *prevtiled(Client *c); static void propertynotify(XEvent *e); +static void pushdown(const Arg *arg); +static void pushup(const Arg *arg); static void quit(const Arg *arg); static Monitor *recttomon(int x, int y, int w, int h); static void resize(Client *c, int x, int y, int w, int h, int bw, int interact); @@ -1327,6 +1330,16 @@ pop(Client *c) arrange(c->mon); } +Client * +prevtiled(Client *c) { + Client *p, *r; + + for(p = selmon->clients, r = NULL; p && p != c; p = p->next) + if(!p->isfloating && ISVISIBLE(p)) + r = p; + return r; +} + void propertynotify(XEvent *e) { @@ -1365,6 +1378,37 @@ propertynotify(XEvent *e) } void +pushdown(const Arg *arg) { + Client *sel = selmon->sel, *c; + + if(!sel || sel->isfloating || sel == nexttiled(selmon->clients)) + return; + if((c = nexttiled(sel->next))) { + detach(sel); + sel->next = c->next; + c->next = sel; + } + focus(sel); + arrange(selmon); +} + +void +pushup(const Arg *arg) { + Client *sel = selmon->sel, *c; + + if(!sel || sel->isfloating) + return; + if((c = prevtiled(sel)) && c != nexttiled(selmon->clients)) { + detach(sel); + sel->next = c; + for(c = selmon->clients; c->next != sel->next; c = c->next); + c->next = sel; + } + focus(sel); + arrange(selmon); +} + +void quit(const Arg *arg) { running = 0; |
