Merge pull request #1341 from emersion/view-at-unmapped

rootston: fix segfault in view_at
This commit is contained in:
Drew DeVault 2018-11-01 21:52:48 +01:00 committed by GitHub
commit 675cf8457e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -439,6 +439,11 @@ void view_destroy(struct roots_view *view) {
view_unmap(view); view_unmap(view);
} }
// Can happen if fullscreened while unmapped, and hasn't been mapped
if (view->fullscreen_output != NULL) {
view->fullscreen_output->fullscreen_view = NULL;
}
if (view->destroy) { if (view->destroy) {
view->destroy(view); view->destroy(view);
} }
@ -576,6 +581,9 @@ static bool view_at(struct roots_view *view, double lx, double ly,
view->wl_shell_surface->state == WLR_WL_SHELL_SURFACE_STATE_POPUP) { view->wl_shell_surface->state == WLR_WL_SHELL_SURFACE_STATE_POPUP) {
return false; return false;
} }
if (view->wlr_surface == NULL) {
return false;
}
double view_sx = lx - view->x; double view_sx = lx - view->x;
double view_sy = ly - view->y; double view_sy = ly - view->y;