With the following code:
class DummyWindow : public DocumentWindow {
public:
DummyWindow() : DocumentWindow(T("Dummy"), Colours::white, DocumentWindow::allButtons)
{
DummyComponent* dummy = new DummyComponent();
dummy->setSize(200, 100);
setContentComponent(dummy, true, true);
}
};
the DummyComponent comes out with a size of 194px x 94px, because JUCE internally subtracts the 3px border of the DocumentWindow somehow from the DummyComponents size.
If the setSize and setContentComponent gets swaped it works like it should, so in this example there is no real problem. But if the DummyComponent sets it desired size in its constructor (like some of mine do) they end with the wrong size.
// Edit:
And I just noticed that it’s possible to force a DocumentWindow this way to become smaller than its minimal size.