view: add MoveToOutput wrap attribute

Support `wrap` in view_get_adjacent_output(). This means that when seeking
an adjacent output in a particular direction from an output that is
already furthest in that direction within the layout, rather than
returning NULL, wrap around from the leftmost to the rightmost, or topmost
to the bottommost and vice versa.

Example usage:

    <action name="MoveToOutput" direction="right" wrap="yes" />

Wrap is disabled by default to keep the user interface consistent.
This commit is contained in:
Johan Malm 2024-03-02 15:42:05 +00:00 committed by Johan Malm
parent 7e338fc365
commit 3c3bcc2765
4 changed files with 69 additions and 27 deletions

View file

@ -503,7 +503,8 @@ void view_on_output_destroy(struct view *view);
void view_connect_map(struct view *view, struct wlr_surface *surface);
void view_destroy(struct view *view);
struct output *view_get_adjacent_output(struct view *view, enum view_edge edge);
struct output *view_get_adjacent_output(struct view *view, enum view_edge edge,
bool wrap);
enum view_axis view_axis_parse(const char *direction);
enum view_edge view_edge_parse(const char *direction);