Show the Bookmarks popup in modal context

Find the focused window, not the main IDE frame.

Useful in diff invoked from the commit dialog.

Follow-up to b5addab
Relates to IDEA-169296
Issues found in IDEA-CR-19062
This commit is contained in:
Kirill Likhodedov
2017-04-21 18:57:25 +03:00
parent 864648f5bd
commit 63ac6b9135
@@ -32,7 +32,7 @@ import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.openapi.wm.ToolWindowManager;
import com.intellij.openapi.wm.WindowManager;
import com.intellij.openapi.wm.ex.WindowManagerEx;
import com.intellij.ui.IdeBorderFactory;
import com.intellij.ui.components.JBList;
import com.intellij.ui.popup.util.DetailViewImpl;
@@ -122,10 +122,10 @@ public class BookmarksAction extends AnAction implements DumbAware, MasterDetail
final Point location = DimensionService.getInstance().getLocation(DIMENSION_SERVICE_KEY, project);
if (location != null) {
popup.showInScreenCoordinates(WindowManager.getInstance().getFrame(project), location);
popup.showInScreenCoordinates(WindowManagerEx.getInstanceEx().getMostRecentFocusedWindow(), location);
}
else {
popup.showCenteredInCurrentWindow(project);
popup.showInBestPositionFor(e.getDataContext());
}
list.getEmptyText().setText("No Bookmarks");