aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/xdg_shell_v6.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop/xdg_shell_v6.c')
-rw-r--r--sway/desktop/xdg_shell_v6.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index b1b8091b..6cb489db 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -172,17 +172,13 @@ static void handle_commit(struct wl_listener *listener, void *data) {
struct sway_xdg_shell_v6_view *xdg_shell_v6_view =
wl_container_of(listener, xdg_shell_v6_view, commit);
struct sway_view *view = &xdg_shell_v6_view->view;
- int width = view->wlr_xdg_surface_v6->geometry.width;
- int height = view->wlr_xdg_surface_v6->geometry.height;
- if (!width && !height) {
- width = view->wlr_xdg_surface_v6->surface->current->width;
- height = view->wlr_xdg_surface_v6->surface->current->height;
- }
- if (!view->natural_width && !view->natural_height) {
- view->natural_width = width;
- view->natural_height = height;
- }
if (view->swayc && container_is_floating(view->swayc)) {
+ int width = view->wlr_xdg_surface_v6->geometry.width;
+ int height = view->wlr_xdg_surface_v6->geometry.height;
+ if (!width && !height) {
+ width = view->wlr_xdg_surface_v6->surface->current->width;
+ height = view->wlr_xdg_surface_v6->surface->current->height;
+ }
view_update_size(view, width, height);
} else {
view_update_size(view, xdg_shell_v6_view->pending_width,
@@ -215,6 +211,12 @@ static void handle_map(struct wl_listener *listener, void *data) {
struct sway_view *view = &xdg_shell_v6_view->view;
struct wlr_xdg_surface_v6 *xdg_surface = view->wlr_xdg_surface_v6;
+ view->natural_width = view->wlr_xdg_surface_v6->geometry.width;
+ view->natural_height = view->wlr_xdg_surface_v6->geometry.height;
+ if (!view->natural_width && !view->natural_height) {
+ view->natural_width = view->wlr_xdg_surface_v6->surface->current->width;
+ view->natural_height = view->wlr_xdg_surface_v6->surface->current->height;
+ }
view_map(view, view->wlr_xdg_surface_v6->surface);
xdg_shell_v6_view->commit.notify = handle_commit;