Native window titlebar and repaint issue

I couldn’t find anything about this yet… happens in the demo atleast. I noticed that if you have native titlebar and then drag another program’s window over JUCE app the JUCE app’s window is not refreshed and the window gets all messed up.

I tried removing the overlay flags, but it didn’t fix it. I didn’t debug much more as my time went understanding JUCE’s internals (been poking around JUCE just few days).

It is as if the draw region requested for repaint is drawn into wrong position. Also if I have the paint debugging (the color overlays) enabled the painting is much slower with native titlebar than with JUCE’s own title. You can easily see that with the “drag shadow” left by the paint debugging.

Curiously if you set WM_NCPAINT not to call DefWindowProc at all there are no problems and drawing is faster. Well, besides the obivious border + titlebar drawing “problem” then.

This atleast under Windows XP, forgot to mention that.

oh, yes - sorry about that one… It looks like sometimes the ncrepaint also involves doing some client repainting. I think it’s just a case of swapping a couple of lines over in juce_win32_Windowing.cpp, like this:

[code] case WM_NCPAINT:
if (wParam != 1)
handlePaintMessage();

            if (hasTitleBar())
                break;

            return 0;

[/code]

Yes, that does the trick. Thanks. :slight_smile: