desktop: Fix activating unmapped views

This can happen sometimes in xwayland, need to guard against this.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
This commit is contained in:
Joshua Ashton 2021-12-31 02:58:34 +00:00 committed by Johan Malm
parent f393dedf3f
commit 295d5172d4

View file

@ -102,7 +102,8 @@ desktop_focus_and_activate_view(struct seat *seat, struct view *view)
seat_focus_surface(seat, NULL);
return;
}
if (input_inhibit_blocks_surface(seat, view->surface->resource)) {
if (view->surface && input_inhibit_blocks_surface(seat, view->surface->resource)) {
return;
}
@ -114,7 +115,8 @@ desktop_focus_and_activate_view(struct seat *seat, struct view *view)
view_minimize(view, false);
return;
}
if (!view->mapped) {
if (!view->mapped || !view->surface) {
return;
}