From 09aba1d41693a406f9ba8866afface28ccec8925 Mon Sep 17 00:00:00 2001 From: justnullname <51329027+justnullname@users.noreply.github.com> Date: Fri, 27 Mar 2026 15:42:57 +0000 Subject: [PATCH] Fix image center flash during window resize on zoom Added DwmFlush() immediately after g_compEngine->Commit() in OnResize and WM_SIZE. This synchronizes the DirectComposition hardware transform submission with the Win32 WM_SIZE vsync, preventing a one-frame screen tearing/flickering issue where the window size was updated but the DirectComposition visual tree was not yet committed. --- QuickView/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/QuickView/main.cpp b/QuickView/main.cpp index ad60691..c086dde 100644 --- a/QuickView/main.cpp +++ b/QuickView/main.cpp @@ -6142,6 +6142,10 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) // [Refactor] Use Centralized SyncDCompState RECT rc; GetClientRect(hwnd, &rc); SyncDCompState(hwnd, (float)rc.right, (float)rc.bottom); + if (g_compEngine) { + g_compEngine->Commit(); + DwmFlush(); + } } @@ -8835,6 +8839,7 @@ void OnResize(HWND hwnd, UINT width, UINT height) { SyncDCompState(hwnd, (float)width, (float)height); } g_compEngine->Commit(); + DwmFlush(); } if (g_uiRenderer) g_uiRenderer->OnResize(width, height); g_toolbar.UpdateLayout((float)width, (float)height);