From: Hirohito Higashi Date: Mon, 27 Jul 2026 20:19:48 +0000 (+0000) Subject: patch 9.2.0863: MS-Windows GUI: window contents can be missing when VimEnter is slow X-Git-Tag: v9.2.0863^0 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=f546abd51b72b46429bec32dfd093ef6868035c4;p=thirdparty%2Fvim.git patch 9.2.0863: MS-Windows GUI: window contents can be missing when VimEnter is slow Problem: On MS-Windows the text area can stay undrawn while a slow VimEnter autocommand runs, so the window shows what was on the screen behind it. Whether this happens depends on when the first paint message arrives. Solution: Draw the text area when the window is opened, instead of waiting for the message loop. related: #20807 closes: #20858 Co-Authored-By: Claude Opus 5 Signed-off-by: Hirohito Higashi Signed-off-by: Christian Brabandt --- diff --git a/src/gui_w32.c b/src/gui_w32.c index 7e6c87ee23..0960b0d82f 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -1665,8 +1665,18 @@ gui_mch_open(void) // Actually open the window, if not already visible // (may be done already in gui_mch_set_shellsize) if (!IsWindowVisible(s_hwnd)) + { ShowWindow(s_hwnd, SW_SHOWDEFAULT); + // Waiting for the message loop leaves the window undrawn while a + // slow VimEnter autocommand runs. The flush presents the DirectX draw. + if (s_textArea != NULL) + { + UpdateWindow(s_textArea); + gui_mch_flush(); + } + } + #ifdef MSWIN_FIND_REPLACE // Init replace string here, so that we keep it when re-opening the // dialog. diff --git a/src/version.c b/src/version.c index 42d645ef49..e5dfd3eaa3 100644 --- a/src/version.c +++ b/src/version.c @@ -758,6 +758,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 863, /**/ 862, /**/