diff options
| author | twells46 <173561638+twells46@users.noreply.github.com> | 2026-04-19 16:58:30 -0500 |
|---|---|---|
| committer | twells46 <173561638+twells46@users.noreply.github.com> | 2026-04-19 16:58:30 -0500 |
| commit | 2f44ee912783e3e57c2619df8e291e8c18ee3082 (patch) | |
| tree | 940e1141a94adce075492fa3f8f4a7e56747da8c /dwl.c | |
| parent | a2d03cf6188350005dbdaac12f3b0fbc4d60c567 (diff) | |
| parent | a2197a8b36f737838b7cff7cfa7a68f0141a4334 (diff) | |
Merge branch 'twdev'
Diffstat (limited to 'dwl.c')
| -rw-r--r-- | dwl.c | 43 |
1 files changed, 43 insertions, 0 deletions
@@ -301,6 +301,7 @@ static void locksession(struct wl_listener *listener, void *data); static void mapnotify(struct wl_listener *listener, void *data); static void maximizenotify(struct wl_listener *listener, void *data); static void monocle(Monitor *m); +static void movestack(const Arg *arg); static void motionabsolute(struct wl_listener *listener, void *data); static void motionnotify(uint32_t time, struct wlr_input_device *device, double sx, double sy, double sx_unaccel, double sy_unaccel); @@ -1840,6 +1841,48 @@ monocle(Monitor *m) } void +movestack(const Arg *arg) +{ + Client *c, *sel = focustop(selmon); + + if (!sel) { + return; + } + + if (wl_list_length(&clients) <= 1) { + return; + } + + if (arg->i > 0) { + wl_list_for_each(c, &sel->link, link) { + if (&c->link == &clients) { + c = wl_container_of(&clients, c, link); + break; /* wrap past the sentinel node */ + } + if (VISIBLEON(c, selmon) || &c->link == &clients) { + break; /* found it */ + } + } + } else { + wl_list_for_each_reverse(c, &sel->link, link) { + if (&c->link == &clients) { + c = wl_container_of(&clients, c, link); + break; /* wrap past the sentinel node */ + } + if (VISIBLEON(c, selmon) || &c->link == &clients) { + break; /* found it */ + } + } + /* backup one client */ + c = wl_container_of(c->link.prev, c, link); + } + + wl_list_remove(&sel->link); + wl_list_insert(&c->link, &sel->link); + arrange(selmon); +} + +void motionabsolute(struct wl_listener *listener, void *data) { /* This event is forwarded by the cursor when a pointer emits an _absolute_ |
