input: Properly handle setting touch focus to NULL

This happens on TOUCH_UP, and we unconditionally dereference view->surface.
dev
Kristian Høgsberg 11 years ago
parent b5a4f986d4
commit c3244d7abc
  1. 3
      src/input.c

@ -1154,7 +1154,8 @@ weston_touch_set_focus(struct weston_seat *seat, struct weston_view *view)
focus_resource_list = &seat->touch->focus_resource_list;
if (seat->touch->focus->surface == view->surface) {
if (view && seat->touch->focus &&
seat->touch->focus->surface == view->surface) {
seat->touch->focus = view;
return;
}

Loading…
Cancel
Save