BR: Desktop switch with SystemTrayIconComponent and setUsingNativeTitleBar (false)

I’ve notice what I assume is a bug when using a SystemTrayIconComponent and a non-native title bar in a GUI app. If I have the app window open and switch desktops on Windows 10, the shadow/outline of the app window remains visible on the new desktop. The window itself is not displayed on the new desktop (as expected). When using setUsingNativeTitleBar (true) the shadow/outline disappears as expected when changing desktop.

The bug can be reproduced by doing the following (using JUCE 6.1.2):

  • create a new GUI application in Projucer,
  • set setUsingNativeTitleBar (false) in Main.cpp,
  • add a SystemTrayIconComponent as a member of MainComponent (doesn’t matter if you do anything else with it, just needs added)
  • change Windows desktop i.e. using ctrl + Win + left/right

Is there some setting I am missing to avoid this behaviour so that the dropshadow doesn’t appear on unwanted desktops?


Thanks for your patience. I’ve had a chance to look at this issue now. As far as I can tell, Windows doesn’t hide “temporary” windows if an app is displaying any non-temporary windows on the current virtual desktop. In the situation you described, the system tray component was preventing the shadow windows from being hidden.

I’ve added a fix here:

Please let us know if you encounter any issues with this change.

1 Like

Thanks! I wasn’t assuming it would be fixed this fast, so that’s great. I will hopefully get the chance to test this fix soon and get back to you if I still have problems.