From f9192ab8fc8ed80b447c1dc3a1503971a682e95c Mon Sep 17 00:00:00 2001 From: Brandon Schaefer Date: Thu, 6 Dec 2018 10:39:33 -0500 Subject: [PATCH] wayland: Do not try to lock on an invalid pointer This happens if you try to lock the pointer and (caps & WL_SEAT_CAPABILITY_POINTER) is false Leading to input->pointer being NULL which ends up bringing the wayland client down (at lease on weston) --- src/video/wayland/SDL_waylandevents.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 033e83d46c83b..9d783f3ca09e7 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -1104,6 +1104,9 @@ int Wayland_input_lock_pointer(struct SDL_WaylandInput *input) if (!d->pointer_constraints) return -1; + if (!input->pointer) + return -1; + if (!input->relative_pointer) { relative_pointer = zwp_relative_pointer_manager_v1_get_relative_pointer(