ComboBox colour alpha error on Apple Silicon Logic Pro

Hi JUCE folks,

I encountered a problem related to colour alpha setting only found on M1 Logic Pro. Basically I made a few ComboBox components in my plugin. I set the popup menu background colour to black with alpha 0.2 by

myLookAndFeel.setColour (PopupMenu::ColourIds::backgroundColourId, Colours::black.withAlpha (0.2f));

The ComboBox components look weird in Logic Pro on my Mac M1 computer, as shown here:
Screenshot 2023-05-24 at 23.51.24

I should mention the colour with alpha looks fine in Reaper as AU plugin on Mac M1. I also tried Logic Pro on an Mac Intel computer where I found no problem.

Is it a bug with Apple Silicon Logic Pro? Or can I find some workaround with JUCE?

Thanks,
Liang

I think you will need to override ComboBox::showPopUp and then use getRootMenu and then show the PopupMenu with some options that set .withParentComponent(Component*).

There are a bunch of other similar threads about this, Apple decided that popover windows will have a purple background, I think as a security measure to stop a malicious software overlaying something with 0% opacity and stealing key presses or whatever.

Adding the PopupMenus to the main window component hierarchy solves this.

Thanks man. By further reading PopupMenu docs, like you said it explained how the problem occurs in withParentComponent method (PopupMenu::Options::withParentComponent).

1 Like