I use getWindowStateAsString() to save the window position, and when the app starts up again I use restoreWindowStateFromString().
This works great when I use the JUCE titlebars.
However, if my code uses setUsingNativeTitleBar() before the window is shown, the size is correct but the position drifts down and to the right.
Looking at the XML I’m writing with ApplicationProperties.getUserSettings()->setValue(…), the window drifts exactly 1 pixel to the right, and 25 pixels down every time the application is restarted. Here are the results of 3 open-close iterations where I did not move the window at all on the screen:
Nothing like that happens for me with the introjucer or other apps that use those methods, so I don’t think you can blame those methods… Could be that on linux the window positions are coming back inconsistently?
I have the same problem on Ubuntu 20.04.2 LTS. Each time the window is opened i have a same offset down.
The value from restoreWindowStateFromString is correct, but a wrong moved call (of 37 pixels down) is triggered just right after a first (good) one. If i don’t use native title bar only the first moved call is done (and such result is fine).
Same behaviour with master/develop branch. Any idea to resolve that?
I reported this 8 years ago. Still happening with my code today. I never understood why and gave up on understanding this bug or having it fixed a long time ago.