From adfe5cd30a40c8d36eb595e710a6f93d9530bbd6 Mon Sep 17 00:00:00 2001 From: Vassiliy Kudryashov Date: Mon, 18 Mar 2013 21:19:33 +0400 Subject: [PATCH] IDEA-53901 Bookmarks window: "Escape" key does not work when the input is in preview pane --- .../openapi/ui/popup/PopupChooserBuilder.java | 2 +- .../ui/popup/StackingPopupDispatcherImpl.java | 15 +-------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/platform/platform-api/src/com/intellij/openapi/ui/popup/PopupChooserBuilder.java b/platform/platform-api/src/com/intellij/openapi/ui/popup/PopupChooserBuilder.java index a1fa4b80dccc..cbe315c0cedc 100644 --- a/platform/platform-api/src/com/intellij/openapi/ui/popup/PopupChooserBuilder.java +++ b/platform/platform-api/src/com/intellij/openapi/ui/popup/PopupChooserBuilder.java @@ -308,7 +308,7 @@ public class PopupChooserBuilder { .setCancelCallback(myCancelCallback) .setAlpha(myAlpha) .setFocusOwners(myFocusOwners) - .setCancelKeyEnabled(myCancelKeyEnabled && !(myChooserComponent instanceof ListWithFilter)) + .setCancelKeyEnabled(myCancelKeyEnabled) .setAdText(myAd, myAdAlignment) .setKeyboardActions(myKeyboardActions) .setMayBeParent(myMayBeParent) diff --git a/platform/platform-impl/src/com/intellij/ui/popup/StackingPopupDispatcherImpl.java b/platform/platform-impl/src/com/intellij/ui/popup/StackingPopupDispatcherImpl.java index d56e645b01fa..a91cf8f32288 100644 --- a/platform/platform-impl/src/com/intellij/ui/popup/StackingPopupDispatcherImpl.java +++ b/platform/platform-impl/src/com/intellij/ui/popup/StackingPopupDispatcherImpl.java @@ -165,20 +165,7 @@ public class StackingPopupDispatcherImpl extends StackingPopupDispatcher impleme } else { popup = getFocusedPopup(); } - - if (popup == null) return false; - - - if (closeRequest) { - if (popup.isCancelKeyEnabled()) { - popup.cancel(); - return true; - } - } else { - return popup.dispatchKeyEvent(e); - } - - return false; + return popup != null && popup.dispatchKeyEvent(e); }