From 62a0104757320b3bcd8a641b813d10cbc0933a94 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Mon, 21 Jul 2014 12:51:10 +0200 Subject: [PATCH] revert: Ctrl-N doesn't show after delete; no input field for Ctrl-N etc --- .../src/com/intellij/ui/popup/AbstractPopup.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java b/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java index da79ae1f769d..6bfc56df4399 100644 --- a/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java +++ b/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java @@ -764,16 +764,7 @@ public class AbstractPopup implements JBPopup { popupOwner = root.getRootPane(); } myPopup = factory.getPopup(popupOwner, myContent, targetBounds.x, targetBounds.y, this); - myPopup.getWindow().setSize(0, 0); - Container parent = myContent.getParent(); - if (parent.getComponentCount() > 1) { - // JDK uses cached heavyweight popup without removing other components - for (Component component : parent.getComponents()) { - if (component != myContent) { - parent.remove(component); - } - } - } + if (myResizable) { final JRootPane root = myContent.getRootPane(); final IdeGlassPaneImpl glass = new IdeGlassPaneImpl(root); @@ -814,7 +805,11 @@ public class AbstractPopup implements JBPopup { listener.beforeShown(new LightweightWindowEvent(this)); } + // can be improved by moving in myPopup code + myPopup.getWindow().pack(); + myPopup.setRequestFocus(myRequestFocus); + LOG.debug("popup window size: " + myPopup.getWindow().getSize()); myPopup.show(); final Window window = SwingUtilities.getWindowAncestor(myContent);