wayland: Do not try to lock on an invalid pointer
authorBrandon Schaefer <brandontschaefer@gmail.com>
Thu, 06 Dec 2018 10:39:33 -0500
changeset 124651f85fce42a31
parent 12464 db15b3c90139
child 12466 b442834306a8
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
     1.1 --- a/src/video/wayland/SDL_waylandevents.c	Thu Dec 06 15:46:40 2018 +0100
     1.2 +++ b/src/video/wayland/SDL_waylandevents.c	Thu Dec 06 10:39:33 2018 -0500
     1.3 @@ -1104,6 +1104,9 @@
     1.4      if (!d->pointer_constraints)
     1.5          return -1;
     1.6  
     1.7 +    if (!input->pointer)
     1.8 +        return -1;
     1.9 +
    1.10      if (!input->relative_pointer) {
    1.11          relative_pointer =
    1.12              zwp_relative_pointer_manager_v1_get_relative_pointer(