Hello,
I encounter an issue with the mouse position when using setFullScreen()
on the main window at initialization on macOS. It seems that if another app grabs the focus (with a mouse click) between the JUCE app initialization and the window creation, the mouse events are not well passed to JUCE app. So if the user launches the JUCE app, and clicks on another app while the JUCE app is initializing, when the JUCE window appears in fullscreen, then the mouse events are not valid and consistent with the graphical component (there is an offset).
It can be a bit tricky to test because the initialization should be long enough to let the user click on another app so an easy way to test it is simply to add a breakpoint in the JUCEApplication::initialise()
method before the window creation so the IDE (Xcode) grabs the focus before the window initialization.
I made a very basic project to demonstrate the bug in this Github repository JuceTest - branch test/macos-fullscreen-bug. The main component contains a text button and the text changes from red to green when the mouse is over. Here is a quick video that shows the bug, the first time I run the app everything works fine, the second, the color of the text doesn’t change when I move the mouse over.
I tested on macOS 12.3 (21E230) - MacBook Pro (16-inch, 2021) / M1 with Xcode Version 13.3 (13E113).
Edit: With JUCE develop branch (14ab027)