On Linux (tested with Debian 11, Wayland), a simple resize of the application window breaks the resize (the getWidth returns a wrong value: almost the double of what it should be. On mouse release, the window gets strangely resized). On Windows and Mac, it works fine.
This happens only since 7.0.6 included (tested up to 7.0.9). It works fine in 7.0.5.
To confirm this, I have build a stripped-down app with basically only a DocumentWindow.
Which windowing system are you using specifically (gnome, kde, etc.)? Are you using a scale factor other than 1.0? Do you have multiple displays connected?
Do you see the same thing in any of the JUCE example projects?
I’m not seeing the issue you reported on develop with Fedora 39 with gnome 45.2 and Wayland. I tried the JUCE DemoRunner, AudioPluginDemo standalone, and your example app (this just displays as a black window with a white border and a title bar, is that correct?).
Digging a bit deeper, it looks like JUCE may be sending an incorrect _NET_WM_MOVERESIZE event to initiate a window resize. Currently, the mouse coordinates are specified relative to the application window, but they should be specified relative to the root window. Perhaps this is the cause of the problems you’re seeing.
Interestingly, I had recently starting doing some testing with WSL on Windows, and I noticed that Projucer and my app both seemed to move unexpectedly on occassion. Since I am not pursuing the Linux builds beyond just experimenting, but I wonder if this is the issue I am also seeing.
Thanks a lot for investing time into this. I was getting crazy when I could NOT reproduce using JUCE’s demo.
But I’ve found how!! setUsingNativeTitleBar(false);
is the culprit! As soon as you set it to false, the resize doesn’t work well, even in the JUCE’s demo.
I tested on Gnome and KDE, both fail in the same way. Multiple displays or one don’t matter.
I’ve updated my sample above, simplified the code and used the latest JUCE version, it should fail for you too .