I have here JUCE5 »Hello, world« application with tray icon. Click on tray icon also shows simple popup menu. IMPORTANT: app is creating instance of ScopedDPIAwarenessDisabler class before showing main window. I need it, because my application scaling must be managed by OS and not by JUCE.
Now, there are some strange issues happening, when using this app with 2 monitors. Monitor settings: left (1st) monitor is not scaled and 2nd HiDPI monitor (on the right) is scaled to 150%.
The actual problem is that in some situations, popup menu is not displayed correctly.
How to replicate the issue (image 1 attached):
App’s main window must be located on right (2nd) monitor - click on the tray icon (1st monitor) shows only menu shadow, and not its items
How to fix it (image 2 attached):
- main window should be moved to the 1st (left) monitor
- ScopedDPIAwarenessDisabler instance should be removed fromcode
Obviously the main culprit is ScopedDPIAwarenessDisabler . I tried this both with JUCE5 and JUCE6. With JUCE5, there are even some optimization settings in VS project, which partially remedy the issue, but that’s not really a solution.
I can provide the code / VS project, it’s very simple.