https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c3644fd4d328b9a6ae2a1…
commit c3644fd4d328b9a6ae2a15b4606d49c497a7f48f
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Mon Jan 30 12:19:39 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Mon Jan 30 12:19:39 2023 +0900
[NTUSER] Move IME window creation code (#5009)
Move the code that creates the default IME window, from IntCreateWindow to
co_UserCreateWindowEx, just before sending WM_NCCALCSIZE message.
CORE-18723 CORE-18754 CORE-18773 CORE-18785 CORE-18802 CORE-18803
---
win32ss/user/ntuser/window.c | 54 ++++++++++++++++++++++----------------------
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/win32ss/user/ntuser/window.c b/win32ss/user/ntuser/window.c
index 142815a6884..d1b650bf4c2 100644
--- a/win32ss/user/ntuser/window.c
+++ b/win32ss/user/ntuser/window.c
@@ -2050,33 +2050,6 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
pWnd->strName.MaximumLength = WindowName->Length + sizeof(UNICODE_NULL);
}
- /* Create the IME window for pWnd */
- if (IS_IMM_MODE() && !(pti->spwndDefaultIme) &&
IntWantImeWindow(pWnd))
- {
- PWND pwndDefaultIme = co_IntCreateDefaultImeWindow(pWnd, pWnd->hModule);
- UserAssignmentLock((PVOID*)&(pti->spwndDefaultIme), pwndDefaultIme);
-
- if (pwndDefaultIme)
- {
- HWND hImeWnd;
- USER_REFERENCE_ENTRY Ref;
- UserRefObjectCo(pwndDefaultIme, &Ref);
-
- hImeWnd = UserHMGetHandle(pwndDefaultIme);
-
- co_IntSendMessage(hImeWnd, WM_IME_SYSTEM, IMS_LOADTHREADLAYOUT, 0);
-
- if (pti->pClientInfo->CI_flags & CI_IMMACTIVATE)
- {
- HKL hKL = pti->KeyboardLayout->hkl;
- co_IntSendMessage(hImeWnd, WM_IME_SYSTEM, IMS_ACTIVATELAYOUT, (LPARAM)hKL);
- pti->pClientInfo->CI_flags &= ~CI_IMMACTIVATE;
- }
-
- UserDerefObjectCo(pwndDefaultIme);
- }
- }
-
/* Correct the window style. */
if ((pWnd->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
{
@@ -2450,6 +2423,33 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
IntLinkHwnd(Window, hwndInsertAfter);
}
+ /* Create the IME window for pWnd */
+ if (IS_IMM_MODE() && !pti->spwndDefaultIme &&
IntWantImeWindow(Window))
+ {
+ PWND pwndDefaultIme = co_IntCreateDefaultImeWindow(Window, Window->hModule);
+ UserAssignmentLock((PVOID*)&pti->spwndDefaultIme, pwndDefaultIme);
+
+ if (pwndDefaultIme)
+ {
+ HWND hImeWnd;
+ USER_REFERENCE_ENTRY Ref;
+ UserRefObjectCo(pwndDefaultIme, &Ref);
+
+ hImeWnd = UserHMGetHandle(pwndDefaultIme);
+
+ co_IntSendMessage(hImeWnd, WM_IME_SYSTEM, IMS_LOADTHREADLAYOUT, 0);
+
+ if (pti->pClientInfo->CI_flags & CI_IMMACTIVATE)
+ {
+ HKL hKL = pti->KeyboardLayout->hkl;
+ co_IntSendMessage(hImeWnd, WM_IME_SYSTEM, IMS_ACTIVATELAYOUT, (LPARAM)hKL);
+ pti->pClientInfo->CI_flags &= ~CI_IMMACTIVATE;
+ }
+
+ UserDerefObjectCo(pwndDefaultIme);
+ }
+ }
+
/* Send the WM_NCCALCSIZE message */
{
// RECT rc;