소스 검색

wayland: Sanity check pointers and protocols before confining

(cherry picked from commit 875e45e70b4086ca8cdff405231fc616f06cda7e)
Frank Praznik 1 년 전
부모
커밋
60e8ff16dc
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      src/video/wayland/SDL_waylandevents.c

+ 4 - 0
src/video/wayland/SDL_waylandevents.c

@@ -2581,6 +2581,10 @@ static void lock_pointer_to_window(SDL_Window *window,
     SDL_VideoData *d = input->display;
     struct zwp_locked_pointer_v1 *locked_pointer;
 
+    if (!d->pointer_constraints || !input->pointer) {
+        return;
+    }
+
     if (w->locked_pointer) {
         return;
     }