aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/transaction.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-19 15:07:07 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-19 16:18:33 +1000
commit2b5a404ac920339a2b9ce32d4718272dee4668b9 (patch)
tree681f45a530a1f8d5966161291c3cb482e52edb6e /sway/desktop/transaction.c
parentMerge pull request #2453 from ianyfan/commands (diff)
downloadsway-2b5a404ac920339a2b9ce32d4718272dee4668b9.tar.gz
sway-2b5a404ac920339a2b9ce32d4718272dee4668b9.tar.zst
sway-2b5a404ac920339a2b9ce32d4718272dee4668b9.zip
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/desktop/transaction.c')
-rw-r--r--sway/desktop/transaction.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c
index c300558a..692fb447 100644
--- a/sway/desktop/transaction.c
+++ b/sway/desktop/transaction.c
@@ -111,8 +111,9 @@ static void copy_pending_state(struct sway_container *container,
111 state->using_csd = view->using_csd; 111 state->using_csd = view->using_csd;
112 } else if (container->type == C_WORKSPACE) { 112 } else if (container->type == C_WORKSPACE) {
113 state->ws_fullscreen = container->sway_workspace->fullscreen; 113 state->ws_fullscreen = container->sway_workspace->fullscreen;
114 state->ws_floating = container->sway_workspace->floating; 114 state->ws_floating = create_list();
115 state->children = create_list(); 115 state->children = create_list();
116 list_cat(state->ws_floating, container->sway_workspace->floating);
116 list_cat(state->children, container->children); 117 list_cat(state->children, container->children);
117 } else { 118 } else {
118 state->children = create_list(); 119 state->children = create_list();
@@ -189,6 +190,7 @@ static void transaction_apply(struct sway_transaction *transaction) {
189 // Any child containers which are being deleted will be cleaned up in 190 // Any child containers which are being deleted will be cleaned up in
190 // transaction_destroy(). 191 // transaction_destroy().
191 list_free(container->current.children); 192 list_free(container->current.children);
193 list_free(container->current.ws_floating);
192 194
193 memcpy(&container->current, &instruction->state, 195 memcpy(&container->current, &instruction->state,
194 sizeof(struct sway_container_state)); 196 sizeof(struct sway_container_state));