diff options
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r-- | sway/desktop/xwayland.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index d0fbcaeb..76265ea9 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c @@ -235,10 +235,6 @@ static void handle_commit(struct wl_listener *listener, void *data) { wl_container_of(listener, xwayland_view, commit); struct sway_view *view = &xwayland_view->view; struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; - if (!view->natural_width && !view->natural_height) { - view->natural_width = xsurface->width; - view->natural_height = xsurface->height; - } if (view->swayc && container_is_floating(view->swayc)) { view_update_size(view, xsurface->width, xsurface->height); view_update_position(view, @@ -263,6 +259,9 @@ static void handle_map(struct wl_listener *listener, void *data) { struct wlr_xwayland_surface *xsurface = data; struct sway_view *view = &xwayland_view->view; + view->natural_width = xsurface->width; + view->natural_height = xsurface->height; + // Wire up the commit listener here, because xwayland map/unmap can change // the underlying wlr_surface wl_signal_add(&xsurface->surface->events.commit, &xwayland_view->commit); |