diff --git a/crates/gpui/src/platform/windows/platform.rs b/crates/gpui/src/platform/windows/platform.rs index c86e0478654254a8f89fc8ec02d0b1f6828cda78..6816a340a280bd794e0885868928b82fa6022bcd 100644 --- a/crates/gpui/src/platform/windows/platform.rs +++ b/crates/gpui/src/platform/windows/platform.rs @@ -845,6 +845,11 @@ impl WindowsPlatformInner { let peek_msg = |msg: &mut _, msg_kind| unsafe { PeekMessageW(msg, None, 0, 0, PM_REMOVE | msg_kind).as_bool() }; + // We need to process a paint message here as otherwise we will re-enter `run_foreground_task` before painting if we have work remaining. + // The reason for this is that windows prefers custom application message processing over system messages. + if peek_msg(&mut msg, PM_QS_PAINT) { + process_message(&msg); + } while peek_msg(&mut msg, PM_QS_INPUT) { process_message(&msg); }