diff --git a/platform/lang-impl/src/com/intellij/find/impl/FindPopupPanel.java b/platform/lang-impl/src/com/intellij/find/impl/FindPopupPanel.java index 65c51a33cd50..37d09efd5b39 100644 --- a/platform/lang-impl/src/com/intellij/find/impl/FindPopupPanel.java +++ b/platform/lang-impl/src/com/intellij/find/impl/FindPopupPanel.java @@ -233,6 +233,8 @@ public class FindPopupPanel extends JBPanel implements FindUI { WindowMoveListener windowListener = new WindowMoveListener(this); myTitlePanel.addMouseListener(windowListener); myTitlePanel.addMouseMotionListener(windowListener); + addMouseListener(windowListener); + addMouseMotionListener(windowListener); Dimension panelSize = getPreferredSize(); Dimension prev = DimensionService.getInstance().getSize(SERVICE_KEY); if (!myCbPreserveCase.isVisible()) { @@ -272,6 +274,7 @@ public class FindPopupPanel extends JBPanel implements FindUI { DumbAwareAction.create(e -> closeImmediately()) .registerCustomShortcutSet(escape == null ? CommonShortcuts.ESCAPE : escape.getShortcutSet(), root, myDisposable); root.setWindowDecorationStyle(JRootPane.NONE); + root.setBorder(PopupBorder.Factory.create(true, true)); UIUtil.markAsPossibleOwner((Dialog)w); w.setBackground(UIUtil.getPanelBackground()); w.setMinimumSize(panelSize); @@ -287,7 +290,7 @@ public class FindPopupPanel extends JBPanel implements FindUI { if (oppositeWindow == w || oppositeWindow != null && oppositeWindow.getOwner() == w) { return; } - if (canBeClosed()) { + if (canBeClosed() || (!myIsPinned.get() && oppositeWindow != null)) { //closeImmediately(); myDialog.doCancelAction(); } @@ -312,7 +315,7 @@ public class FindPopupPanel extends JBPanel implements FindUI { if (!myCanClose.get()) return false; if (myIsPinned.get()) return false; if (!ApplicationManager.getApplication().isActive()) return false; - //if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow() == null) return false; + if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow() == null) return false; if (myFileMaskField.isPopupVisible()) { myFileMaskField.setPopupVisible(false); return false;