소스 검색

Use DefWindowProc for the initial SDL window proc

This makes sure that anything that hooks window creation to set up window proc hooks will call DefWindowProc instead of infinitely recursing when we set up our window proc afterwards.

Fixes https://github.com/libsdl-org/SDL/issues/10529

(cherry picked from commit 6c4f2bd83d1942ee98c7424a0b627ca518c98feb)
Sam Lantinga 1 개월 전
부모
커밋
afeeef9cf5
1개의 변경된 파일2개의 추가작업 그리고 8개의 파일을 삭제
  1. 2 8
      src/video/windows/SDL_windowsevents.c

+ 2 - 8
src/video/windows/SDL_windowsevents.c

@@ -2056,18 +2056,12 @@ int SDL_RegisterApp(const char *name, Uint32 style, void *hInst)
     SDL_Instance = hInst ? hInst : GetModuleHandle(NULL);
 
     /* Register the application class */
+    SDL_zero(wcex);
     wcex.cbSize = sizeof(WNDCLASSEX);
-    wcex.hCursor = NULL;
-    wcex.hIcon = NULL;
-    wcex.hIconSm = NULL;
-    wcex.lpszMenuName = NULL;
     wcex.lpszClassName = SDL_Appname;
     wcex.style = SDL_Appstyle;
-    wcex.hbrBackground = NULL;
-    wcex.lpfnWndProc = WIN_WindowProc;
+    wcex.lpfnWndProc = DefWindowProc;
     wcex.hInstance = SDL_Instance;
-    wcex.cbClsExtra = 0;
-    wcex.cbWndExtra = 0;
 
 #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
     hint = SDL_GetHint(SDL_HINT_WINDOWS_INTRESOURCE_ICON);