summaryrefslogtreecommitdiff
path: root/src/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/input.c')
-rw-r--r--src/input.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/input.c b/src/input.c
index d03333a6..5e82f5dd 100644
--- a/src/input.c
+++ b/src/input.c
@@ -1471,8 +1471,14 @@ weston_touch_set_focus(struct weston_seat *seat, struct weston_view *view)
}
if (view) {
- struct wl_client *surface_client =
- wl_resource_get_client(view->surface->resource);
+ struct wl_client *surface_client;
+
+ if (!view->surface->resource) {
+ seat->touch->focus = NULL;
+ return;
+ }
+
+ surface_client = wl_resource_get_client(view->surface->resource);
move_resources_for_client(focus_resource_list,
&seat->touch->resource_list,
surface_client);