diff options
Diffstat (limited to 'rootston/xdg_shell_v6.c')
-rw-r--r-- | rootston/xdg_shell_v6.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/rootston/xdg_shell_v6.c b/rootston/xdg_shell_v6.c index 2a0660a6..5e76e5d4 100644 --- a/rootston/xdg_shell_v6.c +++ b/rootston/xdg_shell_v6.c @@ -13,8 +13,14 @@ static void get_size(const struct roots_view *view, struct wlr_box *box) { assert(view->type == ROOTS_XDG_SHELL_V6_VIEW); struct wlr_xdg_surface_v6 *surf = view->xdg_surface_v6; - // TODO: surf->geometry can be NULL - memcpy(box, surf->geometry, sizeof(struct wlr_box)); + + if (surf->geometry->width > 0 && surf->geometry->height > 0) { + box->width = surf->geometry->width; + box->height = surf->geometry->height; + } else { + box->width = view->wlr_surface->current->width; + box->height = view->wlr_surface->current->height; + } } static void activate(struct roots_view *view, bool active) { |