How long after XFlush is called does the screen typically refresh correctly?

zhengxianwei <[email protected]> Sun, 29 Jun 2025 19:31:54 +0800
Newsgroups gmane.comp.emulators.wine.devel
Message-ID <CABeGAqU8MP3dXuGuaXsvT1oJ6bMGSN5pUBNSsYFSK0rYV8nxLg@mail.gmail.com>
I wrote a small test program that modifies a region using BitBlt, then
checks the color of that region. I found that even immediately after BitBlt,
it takes over 80 milliseconds before the correct color can be reliably
detected.

Then, I added an XSync(gdi_display, False) after the XFlush in
x11drv_surface_flush, and the delay dropped to around 50–60 milliseconds.

Is this expected?

I was hoping that after BitBlt, the updated color could be detected
immediately, without needing to add a delay or jitter.

But it seems that XFlush only pushes the commands to the X server, and is
not like vkQueuePresentKHR with semaphores or fences, which signal that the
data has been pushed to the display (even though that still doesn’t
guarantee vertical scanout completion).