gdksurface-win32.c: Call _gdk_surface_update_size() more

The current resizing implementation in the GDK-Win32 backend is not
telling GDK early enough for Vulkan that a resize in the surface (i.e.
HWND) is done, so that GDK can re-create swapchain in time, which is
apparent on nVidia drivers (and AMD drivers that utilize the mailbox
presentation mode on Windows) when the HWND is being enlarged
interactively.

To work around this, bar a refactor in the Windows resizing/presentation
code, is to call _gdk_surface_update_size() when we really did resize
the HWND when we handle queued resizes via SetWindowsPos().

The existing call in gdksurface-win32.c in
_gdk_win32_surface_compute_size() remains required, otherwise the
surface won't display initially.

Thanks to Benjamin Otte for pointing this possibility out.
This commit is contained in:
Chun-wei Fan 2024-08-06 00:02:39 +08:00
parent 0acf9caa8e
commit e14670d457

View File

@ -5080,6 +5080,15 @@ gdk_win32_surface_apply_queued_move_resize (GdkSurface *surface,
GDK_NOTE (EVENTS, g_print (" ... set window position\n"));
/*
* Workaround situations in the current Win32 surface resize code that may have notified GDK
* too late for resizes, which manifests on nVidia drivers (and AMD drivers in mailbox
* presentation mode) running under Vulkan when one interactively enlarges the surface (HWND).
*
* See MR !7562 for more details
*/
_gdk_surface_update_size (surface);
return;
}