Fix menu background flashing effect

When using dark theme on light platform theme, there was a
background flashing effect on popups.

See #94
This commit is contained in:
Amit Mendapara
2020-05-14 11:43:59 +05:30
parent b8f953cd26
commit 298f0dfd63

View File

@@ -56,6 +56,10 @@ public class FlatPopupFactory
// macOS and Linux adds drop shadow to heavy weight popups
if( SystemInfo.IS_MAC || SystemInfo.IS_LINUX ) {
Popup popup = getHeavyWeightPopup( owner, contents, x, y );
if ( popup != null ) {
// fix background flashing
SwingUtilities.windowForComponent( contents ).setBackground( contents.getBackground() );
}
return (popup != null) ? popup : super.getPopup( owner, contents, x, y );
}