mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
JRE-1111 [JDK11] java/beans/Beans/TypoInBeanDescription.java crashes at libawt_xawt.so+0x4a30d
(cherry picked from commit b89e6aed0b)
This commit is contained in:
@@ -40,7 +40,6 @@ import com.sun.java.swing.plaf.gtk.GTKConstants.TextDirection;
|
||||
|
||||
import sun.awt.image.SunWritableRaster;
|
||||
import sun.swing.ImageCache;
|
||||
import sun.awt.X11GraphicsDevice;
|
||||
|
||||
/**
|
||||
* GTKEngine delegates all painting job to native GTK libraries.
|
||||
@@ -272,18 +271,6 @@ class GTKEngine {
|
||||
regionToWidgetTypeMap.put(Region.TREE, WidgetType.TREE);
|
||||
regionToWidgetTypeMap.put(Region.TREE_CELL, WidgetType.TREE_CELL);
|
||||
regionToWidgetTypeMap.put(Region.VIEWPORT, WidgetType.VIEWPORT);
|
||||
|
||||
Object value = INSTANCE.getSetting(Settings.GTK_XFT_DPI);
|
||||
if (value instanceof Integer) {
|
||||
int dpi = ((Integer)value).intValue() / 1024;
|
||||
if (dpi == -1) {
|
||||
dpi = 96;
|
||||
}
|
||||
if (dpi < 50) {
|
||||
dpi = 50;
|
||||
}
|
||||
X11GraphicsDevice.setGlobalScale(Math.round(dpi / 96f));
|
||||
}
|
||||
}
|
||||
|
||||
/** Translate Region and JComponent into WidgetType ordinals */
|
||||
|
||||
@@ -45,6 +45,7 @@ import java.util.Map;
|
||||
import sun.awt.SunToolkit;
|
||||
import sun.awt.UNIXToolkit;
|
||||
import sun.awt.OSInfo;
|
||||
import sun.awt.X11GraphicsDevice;
|
||||
import sun.security.action.GetPropertyAction;
|
||||
import sun.swing.DefaultLayoutStyle;
|
||||
import sun.swing.SwingAccessor;
|
||||
@@ -1449,6 +1450,18 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
|
||||
gtkAAFontSettingsCond = SwingUtilities2.isLocalDisplay();
|
||||
aaTextInfo = new HashMap<>(2);
|
||||
SwingUtilities2.putAATextInfo(gtkAAFontSettingsCond, aaTextInfo);
|
||||
|
||||
Object value = GTKEngine.INSTANCE.getSetting(GTKEngine.Settings.GTK_XFT_DPI);
|
||||
if (value instanceof Integer) {
|
||||
int dpi = ((Integer)value).intValue() / 1024;
|
||||
if (dpi == -1) {
|
||||
dpi = 96;
|
||||
}
|
||||
if (dpi < 50) {
|
||||
dpi = 50;
|
||||
}
|
||||
X11GraphicsDevice.setGlobalScale(Math.round(dpi / 96f));
|
||||
}
|
||||
}
|
||||
|
||||
static ReferenceQueue<GTKLookAndFeel> queue = new ReferenceQueue<GTKLookAndFeel>();
|
||||
|
||||
@@ -2753,6 +2753,8 @@ static jobject gtk3_get_setting(JNIEnv *env, Setting property)
|
||||
return get_string_property(env, settings, "gtk-font-name");
|
||||
case GTK_ICON_SIZES:
|
||||
return get_string_property(env, settings, "gtk-icon-sizes");
|
||||
case GTK_XFT_DPI:
|
||||
return get_integer_property(env, settings, "gtk-xft-dpi");
|
||||
case GTK_CURSOR_BLINK:
|
||||
return get_boolean_property(env, settings, "gtk-cursor-blink");
|
||||
case GTK_CURSOR_BLINK_TIME:
|
||||
|
||||
Reference in New Issue
Block a user