Windows stop repainting when another window is opened and Windows scaling is not 100%

We’ve got a strange issue introduced since Component: Revert improvements to opaque component checks · juce-framework/JUCE@10ec977 · GitHub
where if we open a window, the main window stops repainting so appears frozen.

There seems to be a lot commits since then on Windows DPI.

This only seems to happen if Windows scaling is set to something other than 100% (it’s 150% in my screen capture).

Before I dig in to this in detail tomorrow. Has anyone else noticed this or have an idea what it could be?

I have seen something like this in the DemoRunner but I was unable to reproduce it outside the DemoRunner.

Just to be clear are you saying you’ve isolated the issue to that specific commit? Or are you just saying the problem occurs sometime after that commit?

One of the problems I faced was that the demo I saw it in is currently in development and it’s very difficult to back port it onto older JUCE commits making it difficult to perform a bisect. Unfortunately I couldn’t reproduce the issue any other way. Even if I compiled the same demo into its own app the issue disappeared! So if you’re able to do a bisect to find the JUCE commit causing the issue that would be very helpful :folded_hands:

I think it might be related to this thread regarding a change in the paint-logic. Some weird WM_PAINT queue bug that sometimes leaves the whole window white and shows how delayed some repaints happen. I could imagine that something is blocking the main thread:

No, that was the commit which was working so it’s some time after that. I’ll bisect tomorrow to pinpoint it.
Looking at the commits though I imagine it’s something around here:

My money goes on 3. Any other bets?

We have a winner:

258203706cdfc1357effe8cc752672b793cea37d is the first bad commit
commit 258203706cdfc1357effe8cc752672b793cea37d (HEAD)
Author: reuk <reuk@users.noreply.github.com>
Date:   Mon Dec 15 18:01:13 2025 +0000

    Direct2D: Use WM_PAINT and vblank callbacks to drive painting

 modules/juce_gui_basics/native/juce_Windowing_windows.cpp | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
5 Likes

I think I’m just going to revert this on our fork for now.

1 Like

Thanks for reporting. A fix for this issue has been published:

By the way, this fixes another major issue we were seeing here with D2D.

Namely, secondary windows in standalone apps were sometimes slowing down the message thread to the point where they became completely unusable (meaning, they would take 10-12 seconds to respond to mouse clicks).

This seems to have gotten it all up to speed, and I am so happy about it.

1 Like