summaryrefslogtreecommitdiffstats
path: root/sway/desktop/render.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/render.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/render.c')
-rw-r--r--sway/desktop/render.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index 7c48d0d2..aa70903e 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -754,8 +754,6 @@ static void render_container(struct sway_output *output,
754 case L_TABBED: 754 case L_TABBED:
755 render_container_tabbed(output, damage, con, parent_focused); 755 render_container_tabbed(output, damage, con, parent_focused);
756 break; 756 break;
757 case L_FLOATING:
758 sway_assert(false, "Didn't expect to see floating here");
759 } 757 }
760} 758}
761 759
@@ -806,8 +804,7 @@ static void render_floating(struct sway_output *soutput,
806 if (!workspace_is_visible(ws)) { 804 if (!workspace_is_visible(ws)) {
807 continue; 805 continue;
808 } 806 }
809 list_t *floating = 807 list_t *floating = ws->current.ws_floating;
810 ws->current.ws_floating->current.children;
811 for (int k = 0; k < floating->length; ++k) { 808 for (int k = 0; k < floating->length; ++k) {
812 struct sway_container *floater = floating->items[k]; 809 struct sway_container *floater = floating->items[k];
813 render_floating_container(soutput, damage, floater); 810 render_floating_container(soutput, damage, floater);