void (AbstractPopup hint, Editor editor, @NotNull VisualPosition position) { closeHint(); myMouseMovementTracker.reset(); myKeepPopupOnMouseMove = false; editor.putUserData(PopupFactoryImpl.ANCHOR_POPUP_POSITION, position); try { hint.showInBestPositionFor(editor); } finally { editor.putUserData(PopupFactoryImpl.ANCHOR_POPUP_POSITION, null); } Window window = hint.getPopupWindow(); if (window != null) { window.setFocusableWindowState(true); IdeEventQueue.getInstance().addDispatcher(e -> { if (e.getID() == MouseEvent.MOUSE_PRESSED && e.getSource() == window) { myKeepPopupOnMouseMove = true; } else if (e.getID() == WindowEvent.WINDOW_OPENED && !isParentWindow(window, e.getSource())) { closeHint(); } return false; }, hint); } }