From 642c83c532edbbd63606fa84a9ba7a3aa8fe64ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C5=A0mucr?= Date: Thu, 21 May 2026 13:17:35 +0200 Subject: [PATCH] win32: skip redundant sleeps in splash screen event processing The 5x1ms sleep loop in _process_all_gui_events() exists to give X11/Wayland compositors time to redraw asynchronously. On Windows, the GDK Win32 backend redraws synchronously and gdk_display_sync() (called immediately after) flushes the GDI pipeline, making the sleeps pure waste. --- src/gui/splash.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/splash.c b/src/gui/splash.c index b0bd174bf3b4..87ebb1dda595 100644 --- a/src/gui/splash.c +++ b/src/gui/splash.c @@ -45,11 +45,17 @@ static void _process_all_gui_events() // give Gtk a chance to update the screen; we need to let the event // processing run several times for the splash window to actually be // fully displayed/updated +#ifdef _WIN32 + // Win32 GDK backend redraws synchronously via gdk_display_sync() + // called after this function — no need to sleep. + dt_gui_process_events(); +#else for(int i = 0; i < 5; i++) { g_usleep(1000); dt_gui_process_events(); } +#endif } static GtkWidget *_get_logo()