From 66da02d233cb92ce9d40e2dab95864ca24336692 Mon Sep 17 00:00:00 2001 From: hogliux Date: Wed, 30 Aug 2017 14:59:26 +0100 Subject: [PATCH] Fixed an issue where ComboBox popup menus would flicker if a second combobox menu was opened --- modules/juce_gui_basics/widgets/juce_ComboBox.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/juce_gui_basics/widgets/juce_ComboBox.cpp b/modules/juce_gui_basics/widgets/juce_ComboBox.cpp index 95702233a4..a601c86b0e 100644 --- a/modules/juce_gui_basics/widgets/juce_ComboBox.cpp +++ b/modules/juce_gui_basics/widgets/juce_ComboBox.cpp @@ -505,7 +505,14 @@ void ComboBox::showPopupIfNotActive() if (! menuActive) { menuActive = true; - showPopup(); + + SafePointer safePointer (this); + + // as this method was triggered by a mouse event, the same mouse event may have + // exited the modal state of other popups currently on the screen. By calling + // showPopup asynchronously, we are giving the other popups a chance to properly + // close themselves + MessageManager::callAsync([safePointer] () mutable { if (safePointer != nullptr) safePointer->showPopup(); }); } }