aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/layer_shell.c1
-rw-r--r--sway/desktop/output.c9
-rw-r--r--sway/desktop/render.c17
-rw-r--r--sway/desktop/transaction.c17
-rw-r--r--sway/desktop/xdg_shell.c4
-rw-r--r--sway/desktop/xdg_shell_v6.c4
-rw-r--r--sway/desktop/xwayland.c3
7 files changed, 33 insertions, 22 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index a2935883..1fae5db2 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -14,7 +14,6 @@
#include "sway/output.h"
#include "sway/server.h"
#include "sway/tree/arrange.h"
-#include "sway/tree/layout.h"
#include "log.h"
static void apply_exclusive(struct wlr_box *usable_area,
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 3d8bbff5..c228979d 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -16,6 +16,7 @@
#include "log.h"
#include "config.h"
#include "sway/config.h"
+#include "sway/desktop/transaction.h"
#include "sway/input/input-manager.h"
#include "sway/input/seat.h"
#include "sway/layers.h"
@@ -23,7 +24,7 @@
#include "sway/server.h"
#include "sway/tree/arrange.h"
#include "sway/tree/container.h"
-#include "sway/tree/layout.h"
+#include "sway/tree/root.h"
#include "sway/tree/view.h"
#include "sway/tree/workspace.h"
@@ -498,7 +499,7 @@ void output_damage_whole_container(struct sway_output *output,
static void damage_handle_destroy(struct wl_listener *listener, void *data) {
struct sway_output *output =
wl_container_of(listener, output, damage_destroy);
- container_destroy(output->swayc);
+ output_begin_destroy(output->swayc);
}
static void handle_destroy(struct wl_listener *listener, void *data) {
@@ -506,7 +507,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
wl_signal_emit(&output->events.destroy, output);
if (output->swayc) {
- container_destroy(output->swayc);
+ output_begin_destroy(output->swayc);
}
wl_list_remove(&output->link);
@@ -556,7 +557,7 @@ void handle_new_output(struct wl_listener *listener, void *data) {
wl_signal_add(&wlr_output->events.destroy, &output->destroy);
output->destroy.notify = handle_destroy;
- wl_list_insert(&root_container.sway_root->outputs, &output->link);
+ wl_list_insert(&root_container.sway_root->all_outputs, &output->link);
if (!wl_list_empty(&wlr_output->modes)) {
struct wlr_output_mode *mode =
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index 5cf8abc0..5556e5b3 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -24,7 +24,7 @@
#include "sway/server.h"
#include "sway/tree/arrange.h"
#include "sway/tree/container.h"
-#include "sway/tree/layout.h"
+#include "sway/tree/root.h"
#include "sway/tree/view.h"
#include "sway/tree/workspace.h"
@@ -619,9 +619,7 @@ static void render_container_tabbed(struct sway_output *output,
struct sway_container *current = pstate->focused_inactive_child;
struct border_colors *current_colors = &config->border_colors.unfocused;
- double width_gap_adjustment = 2 * pstate->current_gaps;
- int tab_width =
- (pstate->swayc_width - width_gap_adjustment) / pstate->children->length;
+ int tab_width = (pstate->swayc_width) / pstate->children->length;
// Render tabs
for (int i = 0; i < pstate->children->length; ++i) {
@@ -656,11 +654,10 @@ static void render_container_tabbed(struct sway_output *output,
// Make last tab use the remaining width of the parent
if (i == pstate->children->length - 1) {
- tab_width =
- pstate->swayc_width - width_gap_adjustment - tab_width * i;
+ tab_width = pstate->swayc_width - tab_width * i;
}
- render_titlebar(output, damage, child, x, cstate->swayc_y, tab_width,
+ render_titlebar(output, damage, child, x, pstate->swayc_y, tab_width,
colors, title_texture, marks_texture);
if (child == current) {
@@ -721,9 +718,9 @@ static void render_container_stacked(struct sway_output *output,
marks_texture = view ? view->marks_unfocused : NULL;
}
- int y = cstate->swayc_y + titlebar_height * i;
- render_titlebar(output, damage, child, cstate->swayc_x, y,
- cstate->swayc_width, colors, title_texture, marks_texture);
+ int y = pstate->swayc_y + titlebar_height * i;
+ render_titlebar(output, damage, child, pstate->swayc_x, y,
+ pstate->swayc_width, colors, title_texture, marks_texture);
if (child == current) {
current_colors = colors;
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c
index f82e5ef2..c18529fb 100644
--- a/sway/desktop/transaction.c
+++ b/sway/desktop/transaction.c
@@ -54,7 +54,22 @@ static void transaction_destroy(struct sway_transaction *transaction) {
con->instruction = NULL;
}
if (con->destroying && con->ntxnrefs == 0) {
- container_free(con);
+ switch (con->type) {
+ case C_ROOT:
+ break;
+ case C_OUTPUT:
+ output_destroy(con);
+ break;
+ case C_WORKSPACE:
+ workspace_destroy(con);
+ break;
+ case C_CONTAINER:
+ case C_VIEW:
+ container_destroy(con);
+ break;
+ case C_TYPES:
+ break;
+ }
}
free(instruction);
}
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index aae129bd..587deb0f 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -8,12 +8,12 @@
#include "log.h"
#include "sway/decoration.h"
#include "sway/desktop.h"
+#include "sway/desktop/transaction.h"
#include "sway/input/input-manager.h"
#include "sway/input/seat.h"
#include "sway/server.h"
#include "sway/tree/arrange.h"
#include "sway/tree/container.h"
-#include "sway/tree/layout.h"
#include "sway/tree/view.h"
static const struct sway_view_child_impl popup_impl;
@@ -448,7 +448,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
wl_list_remove(&xdg_shell_view->map.link);
wl_list_remove(&xdg_shell_view->unmap.link);
view->wlr_xdg_surface = NULL;
- view_destroy(view);
+ view_begin_destroy(view);
}
struct sway_view *view_from_wlr_xdg_surface(
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index 277c53a3..175416f3 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -7,12 +7,12 @@
#include "log.h"
#include "sway/decoration.h"
#include "sway/desktop.h"
+#include "sway/desktop/transaction.h"
#include "sway/input/input-manager.h"
#include "sway/input/seat.h"
#include "sway/server.h"
#include "sway/tree/arrange.h"
#include "sway/tree/container.h"
-#include "sway/tree/layout.h"
#include "sway/tree/view.h"
static const struct sway_view_child_impl popup_impl;
@@ -441,7 +441,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
wl_list_remove(&xdg_shell_v6_view->map.link);
wl_list_remove(&xdg_shell_v6_view->unmap.link);
view->wlr_xdg_surface_v6 = NULL;
- view_destroy(view);
+ view_begin_destroy(view);
}
struct sway_view *view_from_wlr_xdg_surface_v6(
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index ce7235e4..4e401008 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -14,7 +14,6 @@
#include "sway/server.h"
#include "sway/tree/arrange.h"
#include "sway/tree/container.h"
-#include "sway/tree/layout.h"
#include "sway/tree/view.h"
static const char *atom_map[ATOM_LAST] = {
@@ -341,7 +340,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
wl_list_remove(&xwayland_view->set_hints.link);
wl_list_remove(&xwayland_view->map.link);
wl_list_remove(&xwayland_view->unmap.link);
- view_destroy(&xwayland_view->view);
+ view_begin_destroy(&xwayland_view->view);
}
static void handle_unmap(struct wl_listener *listener, void *data) {