view: require non-NULL surface in view_from_wlr_surface

This commit is contained in:
Jente Hidskes 2021-12-26 15:36:39 +01:00
parent ba9c245393
commit d708a73aca
2 changed files with 5 additions and 4 deletions

3
seat.c
View file

@ -817,6 +817,9 @@ struct cg_view *
seat_get_focus(struct cg_seat *seat)
{
struct wlr_surface *prev_surface = seat->seat->keyboard_state.focused_surface;
if (!prev_surface) {
return NULL;
}
return view_from_wlr_surface(prev_surface);
}