I create a DocumentWindow, and attach a component. The component is exactly sized to 200, 200
If setUsingNativeTitleBar is false, the content area of the window is perfectly sized to 200 by 200. But if setUsingNativeTitleBar is set to true, with no other changes, the content area comes out to 208 x 234. This is making it difficult to get the window to perfectly match the component contents.
I have attached a photo to illustrate the difference.
Well I forgot to report the version of Juce, it is 1.51.16, sorry!
I debugged it and figured it out, it is because isUsingNativeTitleBar() returns false even though I set it to true, because the heavyweight peer hasn’t been created yet and therefore isOnDesktop() returns false.
The workaround is to add the content component after I create the window and add it to the desktop:
Hmm, good point… I had a quick look at whether I could change it so that you wouldn’t have work around that, or at least to add an assertion to warn you if you do it, but can’t see any easy way of doing so…
I agree, I thought to try to fix it but it would get complicated and messy. Perhaps the best solution is to just add a comment to TopLevelWindow or something describing the behavior.