diff --git a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java index d7999ae812ea..e9f38615c1e7 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java @@ -171,6 +171,15 @@ public class DocumentationManager extends DockablePopupManagertrue if quick doc control is configured to not prevent user-IDE interaction (e.g. should be closed if + * the user presses a key); + * false otherwise + */ + public boolean isCloseOnSneeze() { + return myCloseOnSneeze; + } + public boolean hasDockedDocWindow() { return myToolWindow != null; } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/documentation/QuickDocOnMouseOverManager.java b/platform/lang-impl/src/com/intellij/codeInsight/documentation/QuickDocOnMouseOverManager.java index 34a6fb03d04c..be88c67528b0 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/documentation/QuickDocOnMouseOverManager.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/documentation/QuickDocOnMouseOverManager.java @@ -169,10 +169,10 @@ public class QuickDocOnMouseOverManager { // Skip the event if the control is shown because of explicit 'show quick doc' action call. WeakReference ref = myDocumentationManager; - if (ref == null || ref.get() == null) { + if (ref == null || ref.get() == null || !ref.get().isCloseOnSneeze()) { return; } - + // Skip the event if the mouse is under the opened quick doc control. Point hintLocation = hint.getLocationOnScreen(); Dimension hintSize = hint.getSize(); @@ -284,14 +284,20 @@ public class QuickDocOnMouseOverManager { public void run() { myAlarm.cancelAllRequests(); + // Skip the request if it's outdated (the mouse is moved other another element). DelayedQuickDocInfo info = myDelayedQuickDocInfo; if (info == null || !info.targetElement.equals(myActiveElements.get(info.editor))) { return; } + // Skip the request if there is a control shown as a result of explicit 'show quick doc' (Ctrl + Q) invocation. + if (info.docManager.getDocInfoHint() != null && !info.docManager.isCloseOnSneeze()) { + return; + } + + // We don't want to show a quick doc control if there is an active hint (e.g. the mouse is under an invalid element + // and corresponding error info is shown). if (!info.docManager.hasDockedDocWindow() && myHintManager.hasShownHintsThatWillHideByOtherHint(false)) { - // We don't want to show a quick doc control if there is an active hint (e.g. the mouse is under an invalid element - // and corresponding error info is shown). myAlarm.addRequest(this, EditorSettingsExternalizable.getInstance().getQuickDocOnMouseOverElementDelayMillis()); return; }