improve on wrong-sized-popup and empty-gray-popup problems

GitOrigin-RevId: e4cf0c8c032a7659cc8184aaed1718876e3644b0
This commit is contained in:
Gregory.Shrago
2019-05-18 01:02:17 +03:00
committed by intellij-monorepo-bot
parent d09f7ad1d6
commit b7e6877592
2 changed files with 7 additions and 1 deletions
@@ -871,6 +871,7 @@ public final class LafManagerImpl extends LafManager implements PersistentStateC
boolean isHeavyWeightPopup = window instanceof RootPaneContainer && window != UIUtil.getWindow(owner);
if (isHeavyWeightPopup) {
UIUtil.markAsTypeAheadAware(window);
window.setMinimumSize(null); // clear min-size from prev invocations on JBR11
}
if (isHeavyWeightPopup && ((RootPaneContainer)window).getRootPane().getClientProperty(cleanupKey) == null) {
final JRootPane rootPane = ((RootPaneContainer)window).getRootPane();
@@ -53,7 +53,12 @@ public class DarculaJBPopupComboPopup<T> implements ComboPopup,
@Override
public void show() {
myJustClosedViaClick = false;
if (myPopup != null) return;
if (myPopup != null) {
if (myPopup.isVisible()) return;
// onClosed() was not called for some reason
myPopup.cancel();
}
ArrayList<T> items = new ArrayList<>(myComboBox.getModel().getSize());
for (int i = 0, size = myComboBox.getModel().getSize(); i < size; i++) {
items.add(myComboBox.getModel().getElementAt(i));