summaryrefslogtreecommitdiffstats
path: root/sway/desktop/xdg_shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop/xdg_shell.c')
-rw-r--r--sway/desktop/xdg_shell.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index 6d1ccdd7..d563edae 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -175,15 +175,6 @@ static bool wants_floating(struct sway_view *view) {
175 || toplevel->parent; 175 || toplevel->parent;
176} 176}
177 177
178static bool has_client_side_decorations(struct sway_view *view) {
179 struct sway_xdg_shell_view *xdg_shell_view =
180 xdg_shell_view_from_view(view);
181 if (xdg_shell_view == NULL) {
182 return true;
183 }
184 return xdg_shell_view->deco_mode != WLR_SERVER_DECORATION_MANAGER_MODE_SERVER;
185}
186
187static void for_each_surface(struct sway_view *view, 178static void for_each_surface(struct sway_view *view,
188 wlr_surface_iterator_func_t iterator, void *user_data) { 179 wlr_surface_iterator_func_t iterator, void *user_data) {
189 if (xdg_shell_view_from_view(view) == NULL) { 180 if (xdg_shell_view_from_view(view) == NULL) {
@@ -240,7 +231,6 @@ static const struct sway_view_impl view_impl = {
240 .set_tiled = set_tiled, 231 .set_tiled = set_tiled,
241 .set_fullscreen = set_fullscreen, 232 .set_fullscreen = set_fullscreen,
242 .wants_floating = wants_floating, 233 .wants_floating = wants_floating,
243 .has_client_side_decorations = has_client_side_decorations,
244 .for_each_surface = for_each_surface, 234 .for_each_surface = for_each_surface,
245 .for_each_popup = for_each_popup, 235 .for_each_popup = for_each_popup,
246 .close = _close, 236 .close = _close,
@@ -385,15 +375,13 @@ static void handle_map(struct wl_listener *listener, void *data) {
385 view->natural_height = view->wlr_xdg_surface->surface->current.height; 375 view->natural_height = view->wlr_xdg_surface->surface->current.height;
386 } 376 }
387 377
378 view_map(view, view->wlr_xdg_surface->surface);
379
388 struct sway_server_decoration *deco = 380 struct sway_server_decoration *deco =
389 decoration_from_surface(xdg_surface->surface); 381 decoration_from_surface(xdg_surface->surface);
390 if (deco != NULL) { 382 bool csd = !deco || deco->wlr_server_decoration->mode ==
391 xdg_shell_view->deco_mode = deco->wlr_server_decoration->mode; 383 WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT;
392 } else { 384 view_set_csd_from_client(view, csd);
393 xdg_shell_view->deco_mode = WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT;
394 }
395
396 view_map(view, view->wlr_xdg_surface->surface);
397 385
398 if (xdg_surface->toplevel->client_pending.fullscreen) { 386 if (xdg_surface->toplevel->client_pending.fullscreen) {
399 container_set_fullscreen(view->container, true); 387 container_set_fullscreen(view->container, true);