Unverified Commit 83684feb authored by Alex Plate's avatar Alex Plate
Browse files

Remove unused `esc` listener

The problem is that additional listener (that was removed with this commit)
overrides existing esc listeners of content.

Additional listener for esc is redundant because it's never get called.
`com.intellij.ui.popup.AbstractPopup#dispatchKeyEvent` prevents listeners
execution if it returns true. So, if `myCancelKeyEnabled` is `false`,
listener is not executed because of `if` condition and in case of `true`
listeners are not executed.

As long as this additional listener doesn't override existing listeners,
`hide()` function is called with `myEscListener`.

Review: IDEA-CR-45219

(cherry picked from commit f175fc8a)
parent 9dedd777
Showing with 0 additions and 8 deletions
+0 -8
......@@ -250,7 +250,6 @@ public class LightweightHint extends UserDataHolderBase implements Hint {
}
protected void beforeShow() {
}
public boolean vetoesHiding() {
......
......@@ -1139,13 +1139,6 @@ public class AbstractPopup implements JBPopup {
myContent.addMouseListener(mouseAdapter);
Disposer.register(this, () -> myContent.removeMouseListener(mouseAdapter));
if (myCancelKeyEnabled) {
myContent.registerKeyboardAction(__ -> {
cancel();
}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
}
myContent.addKeyListener(mySpeedSearch);
if (myCancelOnMouseOutCallback != null || myCancelOnWindow) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment