aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/xdg_shell_v6.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/desktop/xdg_shell_v6.c
parentf74829d390bab2eccd68923c4b8b82a873322168 (diff)
parentf16529e2588f5e71d6777f4c06dfb58b29308cd0 (diff)
Merge pull request #2703 from RyanDwyer/csd-border
Add CSD to border modes
Diffstat (limited to 'sway/desktop/xdg_shell_v6.c')
-rw-r--r--sway/desktop/xdg_shell_v6.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index 95ca396c..a7838c0f 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -171,15 +171,6 @@ static bool wants_floating(struct sway_view *view) {
|| toplevel->parent;
}
-static bool has_client_side_decorations(struct sway_view *view) {
- struct sway_xdg_shell_v6_view *xdg_shell_v6_view =
- xdg_shell_v6_view_from_view(view);
- if (xdg_shell_v6_view == NULL) {
- return true;
- }
- return xdg_shell_v6_view->deco_mode != WLR_SERVER_DECORATION_MANAGER_MODE_SERVER;
-}
-
static void for_each_surface(struct sway_view *view,
wlr_surface_iterator_func_t iterator, void *user_data) {
if (xdg_shell_v6_view_from_view(view) == NULL) {
@@ -237,7 +228,6 @@ static const struct sway_view_impl view_impl = {
.set_tiled = set_tiled,
.set_fullscreen = set_fullscreen,
.wants_floating = wants_floating,
- .has_client_side_decorations = has_client_side_decorations,
.for_each_surface = for_each_surface,
.for_each_popup = for_each_popup,
.close = _close,
@@ -382,15 +372,13 @@ static void handle_map(struct wl_listener *listener, void *data) {
view->natural_height = view->wlr_xdg_surface_v6->surface->current.height;
}
+ view_map(view, view->wlr_xdg_surface_v6->surface);
+
struct sway_server_decoration *deco =
decoration_from_surface(xdg_surface->surface);
- if (deco != NULL) {
- xdg_shell_v6_view->deco_mode = deco->wlr_server_decoration->mode;
- } else {
- xdg_shell_v6_view->deco_mode = WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT;
- }
-
- view_map(view, view->wlr_xdg_surface_v6->surface);
+ bool csd = !deco || deco->wlr_server_decoration->mode ==
+ WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT;
+ view_update_csd_from_client(view, csd);
if (xdg_surface->toplevel->client_pending.fullscreen) {
container_set_fullscreen(view->container, true);