mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-18 06:59:44 -05:00
rootston: don't segfault when getting size of an unmapped xdg-shell view
This commit is contained in:
parent
adec3f5c0f
commit
42637a52cf
1 changed files with 3 additions and 1 deletions
|
|
@ -63,9 +63,11 @@ static void get_size(const struct roots_view *view, struct wlr_box *box) {
|
||||||
if (surface->geometry->width > 0 && surface->geometry->height > 0) {
|
if (surface->geometry->width > 0 && surface->geometry->height > 0) {
|
||||||
box->width = surface->geometry->width;
|
box->width = surface->geometry->width;
|
||||||
box->height = surface->geometry->height;
|
box->height = surface->geometry->height;
|
||||||
} else {
|
} else if (view->wlr_surface != NULL) {
|
||||||
box->width = view->wlr_surface->current->width;
|
box->width = view->wlr_surface->current->width;
|
||||||
box->height = view->wlr_surface->current->height;
|
box->height = view->wlr_surface->current->height;
|
||||||
|
} else {
|
||||||
|
box->width = box->height = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue