From d71ea6b5f7bf05c61fbc70192785b326dcc0cfeb Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Mon, 16 Sep 2019 21:32:36 +0300 Subject: [PATCH] IDEA-220279: calculate a location of RA popup on expected monitor GitOrigin-RevId: d531730c2793ddceebb11553c7d1eb29e563a69d --- .../ide/actions/runAnything/RunAnythingManager.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/actions/runAnything/RunAnythingManager.java b/platform/lang-impl/src/com/intellij/ide/actions/runAnything/RunAnythingManager.java index 2957b7f6a80a..7898a7271e32 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/runAnything/RunAnythingManager.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/runAnything/RunAnythingManager.java @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.ide.actions.runAnything; import com.intellij.ide.IdeEventQueue; @@ -9,8 +9,8 @@ import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.popup.JBPopup; import com.intellij.openapi.ui.popup.JBPopupFactory; -import com.intellij.openapi.util.DimensionService; import com.intellij.openapi.util.Disposer; +import com.intellij.openapi.util.WindowStateService; import com.intellij.openapi.util.text.StringUtil; import com.intellij.util.ui.JBInsets; import org.jetbrains.annotations.NotNull; @@ -67,7 +67,7 @@ public class RunAnythingManager { .addUserData("SIMPLE_WINDOW") .setResizable(true) .setMovable(true) - .setDimensionServiceKey(project, LOCATION_SETTINGS_KEY, true) + .setDimensionServiceKey(myProject, LOCATION_SETTINGS_KEY, true) .setLocateWithinScreenBounds(false) .createPopup(); Disposer.register(myBalloon, myRunAnythingUI); @@ -87,7 +87,7 @@ public class RunAnythingManager { }); if (myRunAnythingUI.getViewType() == RunAnythingPopupUI.ViewType.SHORT) { - myBalloonFullSize = DimensionService.getInstance().getSize(LOCATION_SETTINGS_KEY, project); + myBalloonFullSize = WindowStateService.getInstance(myProject).getSize(LOCATION_SETTINGS_KEY); Dimension prefSize = myRunAnythingUI.getPreferredSize(); myBalloon.setSize(prefSize); } @@ -117,7 +117,7 @@ public class RunAnythingManager { } private void calcPositionAndShow(Project project, JBPopup balloon) { - Point savedLocation = DimensionService.getInstance().getLocation(LOCATION_SETTINGS_KEY, project); + Point savedLocation = WindowStateService.getInstance(myProject).getLocation(LOCATION_SETTINGS_KEY); if (project != null) { balloon.showCenteredInCurrentWindow(project); @@ -182,7 +182,7 @@ public class RunAnythingManager { private void saveSize() { if (myRunAnythingUI.getViewType() == RunAnythingPopupUI.ViewType.SHORT) { - DimensionService.getInstance().setSize(LOCATION_SETTINGS_KEY, myBalloonFullSize, myProject); + WindowStateService.getInstance(myProject).putSize(LOCATION_SETTINGS_KEY, myBalloonFullSize); } } }