gpui(windows): Force a paint message when running out foreground budget (#46609)

Release Notes:

- Fixed zed no longer rendering on windows in a timely manner if it gets
overloaded with foreground work

Co-authored-by: John Tur <john-tur@outlook.com>
This commit is contained in:
Lukas WirthandJohn Tur authored and GitHub committed 2026-01-12 14:17:21 +00:00
1 parent 0eeb743904
commit 37b05605e2
1 file changed
+5
@@ -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);
}