diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index c2a985ee..7c01bf16 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c @@ -294,8 +294,11 @@ static void handle_commit(struct wl_listener *listener, void *data) { memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box)); if (container_is_floating(view->container)) { view_update_size(view); - wlr_xdg_toplevel_set_size(view->wlr_xdg_toplevel, view->geometry.width, - view->geometry.height); + // Only set the toplevel size the current container actually has a size. + if (view->container->current.width) { + wlr_xdg_toplevel_set_size(view->wlr_xdg_toplevel, view->geometry.width, + view->geometry.height); + } transaction_commit_dirty_client(); } else { view_center_surface(view);