aboutsummaryrefslogtreecommitdiff
path: root/sway/decoration.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-10-03 13:03:06 +0200
committerGitHub <noreply@github.com>2018-10-03 13:03:06 +0200
commit06c214a800cab9119ae4b04371e3f6bbca8a0550 (patch)
treeeed325e37d02fa71858a33e71ef33961395dd16f /sway/decoration.c
parentf74829d390bab2eccd68923c4b8b82a873322168 (diff)
parentf16529e2588f5e71d6777f4c06dfb58b29308cd0 (diff)
downloadsway-06c214a800cab9119ae4b04371e3f6bbca8a0550.tar.xz
Merge pull request #2703 from RyanDwyer/csd-border
Add CSD to border modes
Diffstat (limited to 'sway/decoration.c')
-rw-r--r--sway/decoration.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/sway/decoration.c b/sway/decoration.c
index 0e3e67ac..849fa89c 100644
--- a/sway/decoration.c
+++ b/sway/decoration.c
@@ -1,6 +1,8 @@
#include <stdlib.h>
#include "sway/decoration.h"
+#include "sway/desktop/transaction.h"
#include "sway/server.h"
+#include "sway/tree/arrange.h"
#include "sway/tree/view.h"
#include "log.h"
@@ -24,20 +26,12 @@ static void server_decoration_handle_mode(struct wl_listener *listener,
return;
}
- switch (view->type) {
- case SWAY_VIEW_XDG_SHELL_V6:;
- struct sway_xdg_shell_v6_view *xdg_shell_v6_view =
- (struct sway_xdg_shell_v6_view *)view;
- xdg_shell_v6_view->deco_mode = deco->wlr_server_decoration->mode;
- break;
- case SWAY_VIEW_XDG_SHELL:;
- struct sway_xdg_shell_view *xdg_shell_view =
- (struct sway_xdg_shell_view *)view;
- xdg_shell_view->deco_mode = deco->wlr_server_decoration->mode;
- break;
- default:
- break;
- }
+ bool csd = deco->wlr_server_decoration->mode ==
+ WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT;
+ view_update_csd_from_client(view, csd);
+
+ arrange_container(view->container);
+ transaction_commit_dirty();
}
void handle_server_decoration(struct wl_listener *listener, void *data) {