diff --git a/platform/platform-api/src/com/intellij/openapi/ui/DialogWrapper.java b/platform/platform-api/src/com/intellij/openapi/ui/DialogWrapper.java index 8ddf512c3376..4d04608abd92 100644 --- a/platform/platform-api/src/com/intellij/openapi/ui/DialogWrapper.java +++ b/platform/platform-api/src/com/intellij/openapi/ui/DialogWrapper.java @@ -142,6 +142,7 @@ public abstract class DialogWrapper { }; private List myOptionsButtons = new ArrayList(); private int myCurrentOptionsButtonIndex = -1; + private boolean myResizeInProgress = false; protected String getDoNotShowMessage() { return CommonBundle.message("dialog.options.do.not.show"); @@ -167,6 +168,14 @@ public abstract class DialogWrapper { */ protected DialogWrapper(Project project, boolean canBeParent) { myPeer = createPeer(project, canBeParent); + myPeer.getWindow().addComponentListener(new ComponentAdapter() { + @Override + public void componentResized(ComponentEvent e) { + if (!myResizeInProgress) { + myActualSize = myPeer.getSize(); + } + } + }); createDefaultActions(); } @@ -1611,8 +1620,10 @@ public abstract class DialogWrapper { private void resizeWithAnimation(final Dimension size) { //todo[kb]: fix this PITA + myResizeInProgress = true; if (!Registry.is("enable.animation.on.dialogs")) { setSize(size.width, size.height); + myResizeInProgress = false; return; } @@ -1637,6 +1648,7 @@ public abstract class DialogWrapper { if (myErrorText.shouldBeVisible()) { myErrorText.setVisible(true); } + myResizeInProgress = false; } }.start(); }