mirror of
https://github.com/labwc/labwc.git
synced 2026-02-21 01:40:26 -05:00
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:
parent
7e338fc365
commit
3c3bcc2765
4 changed files with 69 additions and 27 deletions
|
|
@ -397,6 +397,10 @@ action_arg_from_xml_node(struct action *action, const char *nodename, const char
|
|||
}
|
||||
goto cleanup;
|
||||
}
|
||||
if (!strcmp(argument, "wrap")) {
|
||||
action_arg_add_bool(action, argument, parse_bool(content, false));
|
||||
goto cleanup;
|
||||
}
|
||||
break;
|
||||
case ACTION_TYPE_VIRTUAL_OUTPUT_ADD:
|
||||
case ACTION_TYPE_VIRTUAL_OUTPUT_REMOVE:
|
||||
|
|
@ -924,7 +928,8 @@ actions_run(struct view *activator, struct server *server,
|
|||
} else {
|
||||
/* Config parsing makes sure that direction is a valid direction */
|
||||
enum view_edge edge = action_get_int(action, "direction", 0);
|
||||
target = view_get_adjacent_output(view, edge);
|
||||
bool wrap = action_get_bool(action, "wrap", false);
|
||||
target = view_get_adjacent_output(view, edge, wrap);
|
||||
}
|
||||
if (!target) {
|
||||
wlr_log(WLR_ERROR, "Invalid output.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue