On Fri Jun 19 06:48:09 2026 +0000, Rémi Bernon wrote:
```suggestion:-12+0 hwnd = CreateWindowW( test_class.lpszClassName, NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100, 100, 100, NULL, NULL, NULL, NULL ); ok( !!hwnd, "CreateWindowW failed, error %lu ", GetLastError() ); flush_events(); ok_ret( 1, ImmActivateLayout( hkl ) ); ok_ret( 1, ImmLoadIME( hkl ) ); himc = ImmCreateContext(); ok_ne( NULL, himc, HIMC, "%p" ); ctx = ImmLockIMC( himc ); ok_ne( NULL, ctx, INPUTCONTEXT *, "%p" ); process_messages(); memset( ime_calls, 0, sizeof(ime_calls) ); ime_call_count = 0; ``` I'm not sure why this is needed but it's likely only because the window becomes visible, and may need to wait a bit longer for the X11 driver messages. The rest shouldn't depend on any host messages, so lets keep it separated.
Yes, those extra activation / deactivation (which I am reproducing on Gnome at least) are coming from initial show window or maybe some activation changes in the previous test. In test_ImmSetCompositionWindow() that results in spurious WM_IME_ context messages coming from win32u switching active windows. In the added test it completely garbles the test intermittently because now with the changes deactivating context on de-focusing also resets composition string. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11193#note_143642