JRE-1111 [JDK11] java/beans/Beans/TypoInBeanDescription.java crashes at libawt_xawt.so+0x4a30d

(cherry picked from commit b89e6aed0b)
This commit is contained in:
Anton Tarasov
2019-01-18 17:22:18 +03:00
committed by alexey.ushakov@jetbrains.com
parent a2695f50c4
commit e167c274b3
3 changed files with 15 additions and 13 deletions

View File

@@ -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 */

View File

@@ -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;
@@ -1447,6 +1448,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>();

View File

@@ -2693,6 +2693,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: