From 8ecf6e0a938e6e015b34ee41b4da1722d0d4f977 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Fri, 30 Jan 2015 13:00:15 +0100 Subject: [PATCH] different keys for scaled and normal contexts --- .../src/com/intellij/openapi/util/DimensionService.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/platform/platform-api/src/com/intellij/openapi/util/DimensionService.java b/platform/platform-api/src/com/intellij/openapi/util/DimensionService.java index 017d8dafe846..bc82e6177fee 100644 --- a/platform/platform-api/src/com/intellij/openapi/util/DimensionService.java +++ b/platform/platform-api/src/com/intellij/openapi/util/DimensionService.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import com.intellij.openapi.wm.IdeFrame; import com.intellij.openapi.wm.WindowManager; import com.intellij.ui.ScreenUtil; import com.intellij.util.containers.hash.LinkedHashMap; +import com.intellij.util.ui.JBUI; import com.intellij.util.ui.UIUtil; import gnu.trove.TObjectIntHashMap; import org.jdom.Element; @@ -278,6 +279,10 @@ public class DimensionService implements PersistentStateComponent { GraphicsConfiguration gc = env.getScreenDevices()[0].getDefaultConfiguration(); screen = gc.getBounds(); } - return key + '.' + screen.x + '.' + screen.y + '.' + screen.width + '.' + screen.height; + String realKey = key + '.' + screen.x + '.' + screen.y + '.' + screen.width + '.' + screen.height; + if (JBUI.isHiDPI()) { + realKey+="@" + JBUI.scale(1) + "x"; + } + return realKey; } }