mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-100949, IDEA-111958 (Xinerama detection suppressed)
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.intellij.ui;
|
||||
|
||||
import com.intellij.Patches;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.util.containers.WeakHashMap;
|
||||
@@ -165,10 +164,6 @@ public class ScreenUtil {
|
||||
}
|
||||
|
||||
private static Insets calcInsets(GraphicsConfiguration gc) {
|
||||
if (Patches.SUN_BUG_ID_9000030 && GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices().length > 1) {
|
||||
return new Insets(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
return Toolkit.getDefaultToolkit().getScreenInsets(gc);
|
||||
}
|
||||
|
||||
|
||||
@@ -105,6 +105,7 @@ public class StartupUtil {
|
||||
loadSystemLibraries(log);
|
||||
|
||||
if (!Main.isHeadless()) {
|
||||
AppUIUtil.patchSystem();
|
||||
AppUIUtil.updateWindowIcon(JOptionPane.getRootFrame());
|
||||
AppUIUtil.registerBundledFonts();
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ public class X11UiUtil {
|
||||
|
||||
@SuppressWarnings("SpellCheckingInspection")
|
||||
public static void patchDetectedWm(String wmName) {
|
||||
if (X11 == null || Registry.is("idea.x11.skip.wm.patching")) return;
|
||||
if (X11 == null || !Registry.is("ide.x11.override.wm")) return;
|
||||
|
||||
try {
|
||||
if (wmName.startsWith("Mutter") || "Muffin".equals(wmName) || "GNOME Shell".equals(wmName)) {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.ui;
|
||||
|
||||
import com.intellij.Patches;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ApplicationNamesInfo;
|
||||
@@ -25,6 +26,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.popup.Balloon;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.wm.ToolWindowManager;
|
||||
import com.intellij.util.PlatformUtils;
|
||||
@@ -47,6 +49,21 @@ import java.util.List;
|
||||
public class AppUIUtil {
|
||||
private static final String VENDOR_PREFIX = "jetbrains-";
|
||||
|
||||
public static void patchSystem() {
|
||||
if (Patches.SUN_BUG_ID_9000030 && Registry.is("ide.x11.suppress.xinerama")) {
|
||||
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||
if (ge.getScreenDevices().length > 1) {
|
||||
try {
|
||||
@SuppressWarnings("SpellCheckingInspection") Field xinerState = ge.getClass().getDeclaredField("xinerState");
|
||||
xinerState.setAccessible(true);
|
||||
xinerState.set(null, Boolean.FALSE);
|
||||
Logger.getInstance(AppUIUtil.class).info("Xinerama detection suppressed");
|
||||
}
|
||||
catch (Exception ignored) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateWindowIcon(@NotNull Window window) {
|
||||
window.setIconImages(getAppIconImages());
|
||||
}
|
||||
|
||||
@@ -64,7 +64,8 @@ idea.fix.mac.env=true
|
||||
# suppress inspection "UnusedProperty"
|
||||
idea.fix.mac.env.description=On Mac, use shell environment for external processes (effective on restart).
|
||||
|
||||
idea.x11.skip.wm.patching=false
|
||||
ide.x11.override.wm=true
|
||||
ide.x11.suppress.xinerama=true
|
||||
|
||||
ide.appIcon.progress=true
|
||||
ide.appIcon.badge=true
|
||||
|
||||
Reference in New Issue
Block a user