patch 9.0.0408: GUI test sometimes fails on MS-Windows
Problem: GUI test sometimes fails on MS-Windows.
Solution: Make sure Vim is the foreground window. (Ken Takata, closes #11077)
diff --git a/src/gui_w32.c b/src/gui_w32.c
index 20b0a5f..8ae0cd0 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -8649,6 +8649,7 @@
inputs[0].ki.wVk = vkCode;
if (STRICMP(event, "keyup") == 0)
inputs[0].ki.dwFlags = KEYEVENTF_KEYUP;
+ (void)SetForegroundWindow(s_hwnd);
SendInput(ARRAYSIZE(inputs), inputs, sizeof(INPUT));
}
else