diff options
author | emersion <contact@emersion.fr> | 2017-11-11 15:39:15 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2017-11-11 15:39:15 +0100 |
commit | eb89f1dcd2dd820bc86ae0350774aff4d81408e8 (patch) | |
tree | 7ff7ee99b3818cd029cfa57218167e7461afa11b /rootston/xdg_shell_v6.c | |
parent | 698a172701e15283652d813c8f47122be3164dd5 (diff) |
Fix resize issues with some xdg-shell apps.
Also renames view_get_size to view_get_box to be more consistent with wlroots API and make it more obvious that x,y are set (while in roots_view.get_size this isn't the case).
Fixes #407
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) { |