Skip to content

Commit 22fa45b

Browse files
committed
win32: Ensure that text input is initially disabled when creating a window
Windows seems to implicitly enable IME text input on windows created while an IME is active, which causes the IME suggestion window to pop up when keys are pressed, even if a client never explicitly enabled it. Ensure that IME support is initially disabled on new windows; SDL will enable it at a later time, if required.
1 parent c240ed9 commit 22fa45b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/video/windows/SDL_windowswindow.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "../SDL_sysvideo.h"
3434

3535
#include "SDL_windowsvideo.h"
36+
#include "SDL_windowskeyboard.h"
3637
#include "SDL_windowswindow.h"
3738

3839
// Dropfile support
@@ -780,6 +781,9 @@ bool WIN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Properties
780781
return false;
781782
}
782783

784+
// Ensure that the IME isn't active on the new window until explicitly requested.
785+
WIN_StopTextInput(_this, window);
786+
783787
// Inform Windows of the frame change so we can respond to WM_NCCALCSIZE
784788
SetWindowPos(hwnd, NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE);
785789

0 commit comments

Comments
 (0)