mirror of
https://github.com/swaywm/sway.git
synced 2025-11-04 13:29:52 -05:00
changed "layout promote" command to "move first"
This is more consistent with other Sway semantics.
This commit is contained in:
parent
15745abf0c
commit
a62048f15d
5 changed files with 25 additions and 22 deletions
|
|
@ -117,18 +117,6 @@ struct cmd_results *cmd_layout(int argc, char **argv) {
|
|||
"Must be one of <prev|next>.");
|
||||
}
|
||||
swayc_change_layout(parent, layout);
|
||||
} else if (strcasecmp(argv[0], "promote") == 0) {
|
||||
// swap first child in auto layout with currently focused child
|
||||
swayc_t *container = get_focused_view(swayc_active_workspace());
|
||||
swayc_t *parent = container->parent;
|
||||
if (is_auto_layout(parent->layout)) {
|
||||
int focused_idx = index_child(container);
|
||||
swayc_t *first = parent->children->items[0];
|
||||
if (focused_idx > 0) {
|
||||
list_swap(parent->children, 0, focused_idx);
|
||||
swap_geometry(first, container);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue