mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-92343 File Structure popup appears on wrong monitor
This commit is contained in:
@@ -20,6 +20,7 @@ import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.openapi.wm.IdeFrame;
|
||||
import com.intellij.openapi.wm.WindowManager;
|
||||
import com.intellij.ui.ScreenUtil;
|
||||
import com.intellij.util.containers.hash.LinkedHashMap;
|
||||
@@ -252,15 +253,14 @@ public class DimensionService implements PersistentStateComponent<Element> {
|
||||
}
|
||||
|
||||
JFrame frame = null;
|
||||
if (project == null) {
|
||||
final Component owner = IdeFocusManager.findInstance().getFocusOwner();
|
||||
if (owner != null) {
|
||||
frame = UIUtil.getParentOfType(JFrame.class, owner);
|
||||
}
|
||||
if (frame == null) {
|
||||
frame = WindowManager.getInstance().findVisibleFrame();
|
||||
}
|
||||
} else {
|
||||
final Component owner = IdeFocusManager.findInstance().getFocusOwner();
|
||||
if (owner != null) {
|
||||
frame = UIUtil.getParentOfType(JFrame.class, owner);
|
||||
}
|
||||
if (frame == null) {
|
||||
frame = WindowManager.getInstance().findVisibleFrame();
|
||||
}
|
||||
if (project != null && (frame == null || (frame instanceof IdeFrame && project != ((IdeFrame)frame).getProject()))) {
|
||||
frame = WindowManager.getInstance().getFrame(project);
|
||||
}
|
||||
Rectangle screen = new Rectangle(0, 0, 0, 0);
|
||||
|
||||
@@ -747,7 +747,7 @@ public class AbstractPopup implements JBPopup {
|
||||
|
||||
Point xy = new Point(aScreenX, aScreenY);
|
||||
boolean adjustXY = true;
|
||||
if (myDimensionServiceKey != null) {
|
||||
if (myUseDimServiceForXYLocation && myDimensionServiceKey != null) {
|
||||
final Point storedLocation = DimensionService.getInstance().getLocation(myDimensionServiceKey, myProject);
|
||||
if (storedLocation != null) {
|
||||
xy = storedLocation;
|
||||
|
||||
Reference in New Issue
Block a user