mirror of
https://github.com/swaywm/sway.git
synced 2025-11-05 13:29:51 -05:00
clean up container_get_default_layout
This commit is contained in:
parent
065887bb7b
commit
9b567fc37e
4 changed files with 15 additions and 7 deletions
|
|
@ -168,12 +168,22 @@ void container_move(struct sway_container *container,
|
|||
}
|
||||
|
||||
enum sway_container_layout container_get_default_layout(
|
||||
struct sway_container *output) {
|
||||
struct sway_container *con) {
|
||||
if (con->type != C_OUTPUT) {
|
||||
con = container_parent(con, C_OUTPUT);
|
||||
}
|
||||
|
||||
if (!sway_assert(con != NULL,
|
||||
"container_get_default_layout must be called on an attached "
|
||||
" container below the root container")) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (config->default_layout != L_NONE) {
|
||||
return config->default_layout;
|
||||
} else if (config->default_orientation != L_NONE) {
|
||||
return config->default_orientation;
|
||||
} else if (output->width >= output->height) {
|
||||
} else if (con->width >= con->height) {
|
||||
return L_HORIZ;
|
||||
} else {
|
||||
return L_VERT;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue