mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-66333 Quick documentation lookup on mouse hover
Don't show auto quick doc if IDE frame doesn't have focus
This commit is contained in:
+8
@@ -23,6 +23,7 @@ import com.intellij.openapi.editor.event.*;
|
||||
import com.intellij.openapi.editor.ex.EditorSettingsExternalizable;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.popup.JBPopup;
|
||||
import com.intellij.openapi.wm.WindowManager;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
@@ -33,6 +34,7 @@ import com.intellij.util.containers.WeakHashMap;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.HashMap;
|
||||
@@ -55,6 +57,7 @@ public class QuickDocOnMouseOverManager {
|
||||
@NotNull private final Alarm myAlarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD);
|
||||
@NotNull private final Runnable myRequest = new MyShowQuickDocRequest();
|
||||
@NotNull private final Runnable myHintCloseCallback = new MyCloseDocCallback();
|
||||
@NotNull private final WindowManager myWindowManager = WindowManager.getInstance();
|
||||
|
||||
private final Map<Editor, PsiElement /** PSI element which is located under the current mouse position */> myActiveElements
|
||||
= new WeakHashMap<Editor, PsiElement>();
|
||||
@@ -116,6 +119,11 @@ public class QuickDocOnMouseOverManager {
|
||||
return;
|
||||
}
|
||||
|
||||
JFrame frame = myWindowManager.getFrame(project);
|
||||
if (frame != null && !frame.isFocused()) {
|
||||
return;
|
||||
}
|
||||
|
||||
DocumentationManager documentationManager = DocumentationManager.getInstance(project);
|
||||
JBPopup hint = documentationManager.getDocInfoHint();
|
||||
if (hint != null) {
|
||||
|
||||
Reference in New Issue
Block a user