summaryrefslogtreecommitdiff
path: root/sway/tree/arrange.c
diff options
context:
space:
mode:
authorRyan Dwyer <[email protected]>2018-08-19 15:07:07 +1000
committerRyan Dwyer <[email protected]>2018-08-19 16:18:33 +1000
commit2b5a404ac920339a2b9ce32d4718272dee4668b9 (patch)
tree681f45a530a1f8d5966161291c3cb482e52edb6e /sway/tree/arrange.c
parent389d159c81502aa8b951895de11c3720bbd5ba7d (diff)
Replace hacky L_FLOATING container with a list
Workspaces previously had a magical `workspace->floating` container, which had a layout of L_FLOATING and whose children were actual floating views. This allowed some conveniences, but was a hacky solution because the container has to be exempt from focus, coordinate transactions with the workspace, and omit emitting IPC events (which we didn't do). This commit changes it to be a list directly in the sway_workspace. The L_FLOATING layout is no longer used so this has been removed as well. * Fixes incorrect check in the swap command (it checked if the containers had the L_FLOATING layout, but this layout applied to the magical container). * Introduces workspace_add_floating
Diffstat (limited to 'sway/tree/arrange.c')
-rw-r--r--sway/tree/arrange.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sway/tree/arrange.c b/sway/tree/arrange.c
index 494a8461..cf4a5d9a 100644
--- a/sway/tree/arrange.c
+++ b/sway/tree/arrange.c
@@ -144,9 +144,9 @@ static void apply_tabbed_or_stacked_layout(struct sway_container *parent) {
static void arrange_children_of(struct sway_container *parent);
-static void arrange_floating(struct sway_container *floating) {
- for (int i = 0; i < floating->children->length; ++i) {
- struct sway_container *floater = floating->children->items[i];
+static void arrange_floating(list_t *floating) {
+ for (int i = 0; i < floating->length; ++i) {
+ struct sway_container *floater = floating->items[i];
if (floater->type == C_VIEW) {
view_autoconfigure(floater->sway_view);
} else {
@@ -154,7 +154,6 @@ static void arrange_floating(struct sway_container *floating) {
}
container_set_dirty(floater);
}
- container_set_dirty(floating);
}
static void arrange_children_of(struct sway_container *parent) {
@@ -179,9 +178,6 @@ static void arrange_children_of(struct sway_container *parent) {
case L_NONE:
apply_horiz_layout(parent);
break;
- case L_FLOATING:
- arrange_floating(parent);
- break;
}
// Recurse into child containers