aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/container.c6
-rw-r--r--sway/tree/view.c8
2 files changed, 13 insertions, 1 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index d75e34a5..9b671c1d 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -669,6 +669,9 @@ void container_set_floating(struct sway_container *container, bool enable) {
container_init_floating(container);
if (container->view) {
view_set_tiled(container->view, false);
+ if (container->view->using_csd) {
+ container->view->border = B_CSD;
+ }
}
if (old_parent) {
container_reap_empty(old_parent);
@@ -695,6 +698,9 @@ void container_set_floating(struct sway_container *container, bool enable) {
}
if (container->view) {
view_set_tiled(container->view, true);
+ if (container->view->using_csd) {
+ container->view->border = container->view->saved_border;
+ }
}
container->is_sticky = false;
}
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 1c94de4c..9ffcf206 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -309,6 +309,7 @@ void view_request_activate(struct sway_view *view) {
}
void view_set_csd_from_server(struct sway_view *view, bool enabled) {
+ wlr_log(WLR_DEBUG, "Telling view %p to set CSD to %i", view, enabled);
if (view->xdg_decoration) {
uint32_t mode = enabled ?
WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE :
@@ -316,15 +317,20 @@ void view_set_csd_from_server(struct sway_view *view, bool enabled) {
wlr_xdg_toplevel_decoration_v1_set_mode(
view->xdg_decoration->wlr_xdg_decoration, mode);
}
+ view->using_csd = enabled;
}
void view_update_csd_from_client(struct sway_view *view, bool enabled) {
+ wlr_log(WLR_DEBUG, "View %p updated CSD to %i", view, enabled);
if (enabled && view->border != B_CSD) {
view->saved_border = view->border;
- view->border = B_CSD;
+ if (container_is_floating(view->container)) {
+ view->border = B_CSD;
+ }
} else if (!enabled && view->border == B_CSD) {
view->border = view->saved_border;
}
+ view->using_csd = enabled;
}
void view_set_tiled(struct sway_view *view, bool tiled) {