From c685ef081f090d1e15428f55426e02f2274312d0 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 17 Apr 2018 09:31:34 +1000 Subject: Create sway_workspace struct. --- sway/tree/container.c | 1 + sway/tree/layout.c | 18 +----------------- sway/tree/view.c | 7 ++++--- sway/tree/workspace.c | 7 +++++++ 4 files changed, 13 insertions(+), 20 deletions(-) (limited to 'sway/tree') diff --git a/sway/tree/container.c b/sway/tree/container.c index c0067493..f14e9b9a 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -197,6 +197,7 @@ static struct sway_container *container_workspace_destroy( } } + free(workspace->sway_workspace); _container_destroy(workspace); output_damage_whole(output->sway_output); diff --git a/sway/tree/layout.c b/sway/tree/layout.c index ad097f2e..62219bb1 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c @@ -572,7 +572,7 @@ void arrange_windows(struct sway_container *container, return; case C_WORKSPACE: { - if (container->fullscreen) { + if (container->sway_workspace->fullscreen) { return; } struct sway_container *output = @@ -847,22 +847,6 @@ struct sway_container *container_get_in_direction( } } - // TODO WLR fullscreen - /* - if (container->type == C_VIEW && swayc_is_fullscreen(container)) { - wlr_log(L_DEBUG, "Moving from fullscreen view, skipping to output"); - container = container_parent(container, C_OUTPUT); - get_layout_center_position(container, &abs_pos); - struct sway_container *output = - swayc_adjacent_output(container, dir, &abs_pos, true); - return get_swayc_in_output_direction(output, dir); - } - if (container->type == C_WORKSPACE && container->fullscreen) { - sway_log(L_DEBUG, "Moving to fullscreen view"); - return container->fullscreen; - } - */ - struct sway_container *wrap_candidate = NULL; while (true) { bool can_move = false; diff --git a/sway/tree/view.c b/sway/tree/view.c index 10285ad0..e7a267ec 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -7,6 +7,7 @@ #include "sway/tree/container.h" #include "sway/tree/layout.h" #include "sway/tree/view.h" +#include "sway/tree/workspace.h" void view_init(struct sway_view *view, enum sway_view_type type, const struct sway_view_impl *impl) { @@ -90,10 +91,10 @@ void view_set_fullscreen(struct sway_view *view, bool fullscreen) { view->is_fullscreen = fullscreen; if (fullscreen) { - workspace->fullscreen = view; + workspace->sway_workspace->fullscreen = view; view_configure(view, 0, 0, output->wlr_output->width, output->wlr_output->height); } else { - workspace->fullscreen = NULL; + workspace->sway_workspace->fullscreen = NULL; arrange_windows(workspace, -1, -1); } @@ -105,7 +106,7 @@ void view_set_fullscreen(struct sway_view *view, bool fullscreen) { void view_close(struct sway_view *view) { if (view->is_fullscreen) { struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE); - ws->fullscreen = NULL; + ws->sway_workspace->fullscreen = NULL; } if (view->impl->close) { diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index 316f01e4..7f3c1903 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c @@ -59,6 +59,13 @@ struct sway_container *workspace_create(struct sway_container *output, workspace->layout = container_get_default_layout(output); workspace->workspace_layout = workspace->layout; + struct sway_workspace *swayws = calloc(1, sizeof(struct sway_workspace)); + if (!swayws) { + return NULL; + } + swayws->swayc = workspace; + workspace->sway_workspace = swayws; + container_add_child(output, workspace); container_sort_workspaces(output); container_create_notify(workspace); -- cgit v1.2.3-54-g00ecf