Skip to content

Commit 6c4f2bd

Browse files
committed
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 #10529
1 parent a82e8a7 commit 6c4f2bd

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/video/windows/SDL_windowsevents.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2729,18 +2729,12 @@ bool SDL_RegisterApp(const char *name, Uint32 style, void *hInst)
27292729
SDL_Instance = hInst ? (HINSTANCE)hInst : GetModuleHandle(NULL);
27302730

27312731
// Register the application class
2732+
SDL_zero(wcex);
27322733
wcex.cbSize = sizeof(WNDCLASSEX);
2733-
wcex.hCursor = NULL;
2734-
wcex.hIcon = NULL;
2735-
wcex.hIconSm = NULL;
2736-
wcex.lpszMenuName = NULL;
27372734
wcex.lpszClassName = SDL_Appname;
27382735
wcex.style = SDL_Appstyle;
2739-
wcex.hbrBackground = NULL;
2740-
wcex.lpfnWndProc = WIN_WindowProc;
2736+
wcex.lpfnWndProc = DefWindowProc;
27412737
wcex.hInstance = SDL_Instance;
2742-
wcex.cbClsExtra = 0;
2743-
wcex.cbWndExtra = 0;
27442738

27452739
#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
27462740
hint = SDL_GetHint(SDL_HINT_WINDOWS_INTRESOURCE_ICON);

0 commit comments

Comments
 (0)