소스 검색

wayland: Check for the input handle before checking the keyboard handle

(cherry picked from commit be2cb0006644cb17cafca449f2d69c989e18ed2f)
Ethan Lee 2 년 전
부모
커밋
b7e8e6f3b8
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      src/video/wayland/SDL_waylandkeyboard.c

+ 3 - 2
src/video/wayland/SDL_waylandkeyboard.c

@@ -145,8 +145,9 @@ Wayland_HasScreenKeyboardSupport(_THIS)
      * input protocol, make sure we don't have any physical keyboards either.
      */
     SDL_VideoData *driverdata = _this->driverdata;
-    return (driverdata->input->keyboard == NULL &&
-            driverdata->text_input_manager != NULL);
+    SDL_bool haskeyboard = (driverdata->input != NULL) && (driverdata->input->keyboard != NULL);
+    SDL_bool hastextmanager = (driverdata->text_input_manager != NULL);
+    return (!haskeyboard && hastextmanager);
 }
 
 #endif /* SDL_VIDEO_DRIVER_WAYLAND */