diff options
author | emersion <contact@emersion.fr> | 2018-03-12 10:42:41 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-03-12 10:42:41 +0100 |
commit | 42637a52cf2779ec05f0fdb97df416e21438a77b (patch) | |
tree | 411c50e829187235b3d4f2d13a0327c681d4ac7e /rootston/xdg_shell_v6.c | |
parent | adec3f5c0fec7cc3aae5c68128d23dfe24950fb3 (diff) |
rootston: don't segfault when getting size of an unmapped xdg-shell view
Diffstat (limited to 'rootston/xdg_shell_v6.c')
-rw-r--r-- | rootston/xdg_shell_v6.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/rootston/xdg_shell_v6.c b/rootston/xdg_shell_v6.c index 1f6f25eb..c81cd16a 100644 --- a/rootston/xdg_shell_v6.c +++ b/rootston/xdg_shell_v6.c @@ -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) { box->width = surface->geometry->width; box->height = surface->geometry->height; - } else { + } else if (view->wlr_surface != NULL) { box->width = view->wlr_surface->current->width; box->height = view->wlr_surface->current->height; + } else { + box->width = box->height = 0; } } |