diff options
Diffstat (limited to 'sway/desktop/xdg_shell.c')
-rw-r--r-- | sway/desktop/xdg_shell.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index 6d1ccdd7..a8b527a7 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 | ||
178 | static 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 | |||
187 | static void for_each_surface(struct sway_view *view, | 178 | static 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,16 +375,16 @@ 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 | ||
388 | struct sway_server_decoration *deco = | ||
389 | decoration_from_surface(xdg_surface->surface); | ||
390 | if (deco != NULL) { | ||
391 | xdg_shell_view->deco_mode = deco->wlr_server_decoration->mode; | ||
392 | } else { | ||
393 | xdg_shell_view->deco_mode = WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT; | ||
394 | } | ||
395 | |||
396 | view_map(view, view->wlr_xdg_surface->surface); | 378 | view_map(view, view->wlr_xdg_surface->surface); |
397 | 379 | ||
380 | if (!view->xdg_decoration) { | ||
381 | struct sway_server_decoration *deco = | ||
382 | decoration_from_surface(xdg_surface->surface); | ||
383 | bool csd = !deco || deco->wlr_server_decoration->mode == | ||
384 | WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT; | ||
385 | view_update_csd_from_client(view, csd); | ||
386 | } | ||
387 | |||
398 | if (xdg_surface->toplevel->client_pending.fullscreen) { | 388 | if (xdg_surface->toplevel->client_pending.fullscreen) { |
399 | container_set_fullscreen(view->container, true); | 389 | container_set_fullscreen(view->container, true); |
400 | arrange_workspace(view->container->workspace); | 390 | arrange_workspace(view->container->workspace); |