mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-205497 QuickDoc popup appears on another monitor if invoked from "Brief Info" popup
This commit is contained in:
+9
-3
@@ -856,9 +856,15 @@ public class DocumentationComponent extends JPanel implements Disposable, DataPr
|
||||
}
|
||||
|
||||
private DataContext getDataContext() {
|
||||
Component referenceComponent = SoftReference.dereference(myReferenceComponent);
|
||||
if (referenceComponent == null) referenceComponent = IdeFocusManager.getInstance(myManager.myProject).getFocusOwner();
|
||||
if (myReferenceComponent == null) myReferenceComponent = new WeakReference<>(referenceComponent);
|
||||
Component referenceComponent;
|
||||
if (myReferenceComponent == null) {
|
||||
referenceComponent = IdeFocusManager.getInstance(myManager.myProject).getFocusOwner();
|
||||
myReferenceComponent = new WeakReference<>(referenceComponent);
|
||||
}
|
||||
else {
|
||||
referenceComponent = SoftReference.dereference(myReferenceComponent);
|
||||
if (referenceComponent == null || ! referenceComponent.isShowing()) referenceComponent = myHint.getComponent();
|
||||
}
|
||||
return DataManager.getInstance().getDataContext(referenceComponent);
|
||||
}
|
||||
|
||||
|
||||
@@ -505,7 +505,14 @@ public class AbstractPopup implements JBPopup {
|
||||
return relativePointWithDominantRectangle(layeredPane, dominantArea);
|
||||
}
|
||||
}
|
||||
RelativePoint location = JBPopupFactory.getInstance().guessBestPopupLocation(dataContext);
|
||||
RelativePoint location;
|
||||
Component contextComponent = dataContext.getData(PlatformDataKeys.CONTEXT_COMPONENT);
|
||||
if (contextComponent == myComponent) {
|
||||
location = new RelativePoint(myComponent, new Point());
|
||||
}
|
||||
else {
|
||||
location = JBPopupFactory.getInstance().guessBestPopupLocation(dataContext);
|
||||
}
|
||||
if (myLocateWithinScreen) {
|
||||
Point screenPoint = location.getScreenPoint();
|
||||
Rectangle rectangle = new Rectangle(screenPoint, getSizeForPositioning());
|
||||
|
||||
Reference in New Issue
Block a user