Movestack functionality

This commit is contained in:
2026-04-12 20:34:46 +02:00
parent e7c182102a
commit 46591aa847
2 changed files with 37 additions and 0 deletions
+35
View File
@@ -305,6 +305,7 @@ static void motionnotify(uint32_t time, struct wlr_input_device *device, double
double sy, double sx_unaccel, double sy_unaccel);
static void motionrelative(struct wl_listener *listener, void *data);
static void moveresize(const Arg *arg);
static void movestack(const Arg *arg);
static void outputmgrapply(struct wl_listener *listener, void *data);
static void outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int test);
static void outputmgrtest(struct wl_listener *listener, void *data);
@@ -1808,6 +1809,8 @@ unset_fullscreen:
if (w != c && w != p && w->isfullscreen && m == w->mon && (w->tags & c->tags))
setfullscreen(w, 0);
}
if (c->mon)
focusclient(c, 1);
}
void
@@ -3099,6 +3102,38 @@ xytonode(double x, double y, struct wlr_surface **psurface,
if (pl) *pl = l;
}
void
movestack(const Arg *arg)
{
Client *c, *sel = focustop(selmon);
if (!sel || !selmon || !selmon->lt[selmon->sellt]->arrange || sel->isfloating)
return;
if (arg->i > 0) {
wl_list_for_each(c, &sel->link, link) {
if (&c->link == &clients)
continue;
if (VISIBLEON(c, selmon) && !c->isfloating)
break;
}
} else {
wl_list_for_each_reverse(c, &sel->link, link) {
if (&c->link == &clients)
continue;
if (VISIBLEON(c, selmon) && !c->isfloating)
break;
}
}
if (c == sel)
return;
wl_list_remove(&sel->link);
if (arg->i > 0)
wl_list_insert(&c->link, &sel->link);
else
wl_list_insert(c->link.prev, &sel->link);
arrange(selmon);
}
void
zoom(const Arg *arg)
{