Avoid ugly window jump at start?

I’m probably dumb, but is there a way to avoid the window to jump on screen (Linux only) when its position is explicitly set at start/open/creation?

For instance using a default project from Projucer i get the result below (on Ubuntu 20.04).

The Projucer executable itself doesn’t do that.
I guess there’s a trick.
It seems i’ll have to find it using the hard way :grimacing: (trials and errors)!

So it didn’t required expected pain. :laughing:

  1. Make the DocumentWindow NOT added to desktop at creation.
  2. And addToDesktop after setting the bounds.

IMHO it should be (if it is not already the case) explained/highlighted in tutorials.
With the current behavior it makes JUCE looking like broken on Ubuntu!

class MainWindow : public juce::DocumentWindow
{
    public:
        MainWindow (juce::String name) :
            DocumentWindow (name, juce::Colours::black, DocumentWindow::allButtons, false)
        {
            setUsingNativeTitleBar (true);
            setContentOwned (new MainComponent(), true);
            setResizable (true, true);
            centreWithSize (getWidth(), getHeight());
            setVisible (true);
            addToDesktop();
        }

        void closeButtonPressed() override
        {
            JUCEApplication::getInstance()->systemRequestedQuit();
        }

    private:
        JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainWindow)
};

Jump.zip (2.5 KB)