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
This commit is contained in:
emersion 2017-11-11 15:39:15 +01:00
parent 698a172701
commit eb89f1dcd2
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
4 changed files with 22 additions and 16 deletions

View file

@ -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) {