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

@ -163,7 +163,7 @@ Actions are used in menus and keyboard/mouse bindings.
to the center of the window. If the given output does not contain
any windows, the cursor is centered on the given output.
*<action name="MoveToOutput" name="HDMI-A-1" direction="value" />*
*<action name="MoveToOutput" name="HDMI-A-1" direction="value" wrap="no" />*
Moves active window to other output, unless the window state is
fullscreen.
@ -172,6 +172,9 @@ Actions are used in menus and keyboard/mouse bindings.
be one of "left", "right", "up" or "down" to indicate that the window
should be moved to the next output in that direction (if one exists).
*wrap* [yes|no] When using the direction attribute, wrap around from
right-to-left or top-to-bottom, and vice versa. Default no.
*<action name="FitToOutput" />*
Resizes active window size to width and height of the output when the
window size exceeds the output size.