Compare commits

...

6 Commits
999 ... 462

Author SHA1 Message Date
Artem Bochkarev
4a6a572226 JBR-1762: fixed review comments
(cherry picked from commit 0efbe5d9b9)
2019-09-13 18:59:33 +03:00
Artem Bochkarev
d21535e2ac JBR-1762: request focus of immediate parent when dispose popup
because requesting focus for frame-parent causes to close whole popup chain

(cherry picked from commit 7a2ccfc521)
2019-09-13 18:59:29 +03:00
Anton Tarasov
36ff59d837 JBR-1834 [linux] runtime hidpi switch is broken
(cherry picked from commit eaa04303a7)
2019-09-09 18:02:51 +03:00
Konstantin Bulenkov
1a59022fa3 Revert "Update JetBrains Mono to 0.17"
This reverts commit 0fb5c9ed

(cherry picked from commit 483234fe7d)
2019-09-03 14:50:38 +07:00
Dmitry Batrak
b19c7ce1ef JBR-1805 Hard to read font rendering for Courier New
updating fix for JBR-1777

(cherry picked from commit 6790353282)
2019-09-03 14:50:00 +07:00
Vitaly Provodin
78df138d4e updated JTreg exclude list 2019-09-03 09:54:20 +07:00
6 changed files with 46 additions and 36 deletions

View File

@@ -72,6 +72,15 @@ public class FontFamily {
return;
}
family.ensureFontsLoaded();
if (FontUtilities.isWindows) {
synchronized (family.fontSequence) {
if (family.stylesMask != 0x10 && (family.plain == font2D || family.bold == font2D ||
family.italic == font2D || family.bolditalic == font2D)) {
byte styleBit = getWinFontStyleBit(font2D);
family.stylesMask = (byte) (family.stylesMask & ~styleBit);
}
}
}
if (family.plain == font2D) {
family.plain = null;
}
@@ -297,9 +306,7 @@ public class FontFamily {
}
if (FontUtilities.isWindows && stylesMask != 0x10) {
// Windows seems to ignore bold attribute from fsSelection field, and consider only font's weight
int winFontStyle = (font.getWeight() >= 410 ? 1 : 0) | (style & Font.ITALIC);
byte styleBit = (byte) (1 << winFontStyle);
byte styleBit = getWinFontStyleBit(font);
byte newMask = (byte) (stylesMask | styleBit);
stylesMask = newMask == stylesMask ? 0x10 : newMask;
}
@@ -335,6 +342,12 @@ public class FontFamily {
}
}
private static byte getWinFontStyleBit(Font2D font) {
// Windows seems to ignore bold attribute from fsSelection field, and consider only font's weight
int winFontStyle = (font.getWeight() >= 410 ? 1 : 0) | (font.getStyle() & Font.ITALIC);
return (byte) (1 << winFontStyle);
}
public Font2D getFontWithExactStyleMatch(int style) {
ensureFontsLoaded();
switch (style) {

View File

@@ -25,23 +25,7 @@
package sun.awt.X11;
import java.awt.AWTEvent;
import java.awt.Component;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Image;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.SystemColor;
import java.awt.Window;
import java.awt.*;
import java.awt.event.ComponentEvent;
import java.awt.event.FocusEvent;
import java.awt.event.InvocationEvent;
@@ -52,6 +36,7 @@ import java.io.UnsupportedEncodingException;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.*;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
@@ -1302,9 +1287,20 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
*/
if (isSimpleWindow()) {
if (target == XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow()) {
Window owner = getDecoratedOwner((Window)target);
((XWindowPeer)AWTAccessor.getComponentAccessor().getPeer(owner)).
requestWindowFocus(() -> {}, () -> {});
// fix for: JBR-1762 Flotating navigation bar closes on navigate
// Use the same logic as in MacOS (see LWWindowPeer, was introduced in:
// 54bb2dd097 'JBR-1417 JBR 11 does not support chain of popups)'
Window targetOwner = ((Window)target).getOwner();
while (targetOwner != null && (targetOwner.getOwner() != null && !targetOwner.isFocusableWindow())) {
targetOwner = targetOwner.getOwner();
}
if (targetOwner != null) {
final XWindowPeer xwndpeer = ((XWindowPeer)AWTAccessor.getComponentAccessor().getPeer(targetOwner));
if (xwndpeer != null) {
xwndpeer.requestWindowFocus(() -> {}, () -> {});
}
}
}
}
}

View File

@@ -66,8 +66,8 @@ public final class X11GraphicsDevice extends GraphicsDevice
private boolean shutdownHookRegistered;
private int scale;
private final AtomicBoolean isScaleFactorDefault = new AtomicBoolean(false);
private static final int XRM_XFT_DPI;
private static volatile int XFT_DPI;
private static volatile int xrmXftDpi;
private static volatile int xftDpi;
private static final int GDK_SCALE;
private static final double GDK_DPI_SCALE;
private static final double GDK_SCALE_MULTIPLIER;
@@ -91,7 +91,7 @@ public final class X11GraphicsDevice extends GraphicsDevice
if (!GraphicsEnvironment.isHeadless()) {
initIDs();
}
XRM_XFT_DPI = getXrmXftDpi(-1);
xrmXftDpi = getXrmXftDpi(-1);
GDK_SCALE = (int)getGdkScale("GDK_SCALE", -1);
GDK_DPI_SCALE = getGdkScale("GDK_DPI_SCALE", -1);
GDK_SCALE_MULTIPLIER = GDK_SCALE != -1 ? GDK_SCALE * (GDK_DPI_SCALE != -1 ? GDK_DPI_SCALE : 1) : 1;
@@ -505,6 +505,7 @@ public final class X11GraphicsDevice extends GraphicsDevice
* X11GraphicsEnvironment when the display mode has been changed.
*/
public synchronized void displayChanged() {
xrmXftDpi = getXrmXftDpi(-1);
scale = initScaleFactor(1);
// On X11 the visuals do not change, and therefore we don't need
// to reset the defaultConfig, config, doubleBufferVisuals,
@@ -540,9 +541,9 @@ public final class X11GraphicsDevice extends GraphicsDevice
}
public static void setXftDpi(int dpi) {
XFT_DPI = dpi;
xftDpi = dpi;
boolean uiScaleEnabled = SunGraphicsEnvironment.isUIScaleEnabled(dpi);
double xftDpiScale = uiScaleEnabled ? XFT_DPI / 96.0 : 1.0;
double xftDpiScale = uiScaleEnabled ? xftDpi / 96.0 : 1.0;
for (GraphicsDevice gd : GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()) {
X11GraphicsDevice x11gd = (X11GraphicsDevice)gd;
synchronized (x11gd.isScaleFactorDefault) {
@@ -567,11 +568,11 @@ public final class X11GraphicsDevice extends GraphicsDevice
if (nativeScale > 0) {
return (int)Math.round(nativeScale * gdkScaleMult);
}
if (XRM_XFT_DPI > 0) {
return (int)Math.round((XRM_XFT_DPI / 96.0) * gdkScaleMult);
if (xrmXftDpi > 0) {
return (int)Math.round((xrmXftDpi / 96.0) * gdkScaleMult);
}
if (XFT_DPI > 0) {
return (int)Math.round((XFT_DPI / 96.0) * gdkScaleMult);
if (xftDpi > 0) {
return (int)Math.round((xftDpi / 96.0) * gdkScaleMult);
}
}
return defValue;
@@ -581,8 +582,8 @@ public final class X11GraphicsDevice extends GraphicsDevice
* Used externally for diagnostic purpose.
*/
public String[][] getDpiInfo() {
int xftDpi = XRM_XFT_DPI != -1 ? XRM_XFT_DPI : XFT_DPI;
String xftDpiStr = xftDpi != -1 ? String.valueOf(xftDpi) : "undefined";
int dpi = xrmXftDpi != -1 ? xrmXftDpi : xftDpi;
String xftDpiStr = dpi != -1 ? String.valueOf(dpi) : "undefined";
double gsettingsScale = getNativeScaleFactor(screen, -1);
String gsettingsScaleStr = gsettingsScale != -1 ? String.valueOf(gsettingsScale) : "undefined";
String gdkScaleStr = GDK_SCALE != -1 ? String.valueOf(GDK_SCALE) : "undefined";

View File

@@ -530,7 +530,7 @@ java/awt/Modal/ToFront/FrameToFrontTKModal2Test.java
java/awt/Modal/ToFront/FrameToFrontTKModal3Test.java 8196441 macosx-all,windows-all,linux-all
java/awt/Modal/ToFront/FrameToFrontTKModal4Test.java 8196441 macosx-all,windows-all,linux-all
java/awt/Modal/ToFront/FrameToFrontTKModal5Test.java 8196441 macosx-all,windows-all,linux-all
java/awt/Mouse/EnterExitEvents/DragWindowOutOfFrameTest.java 8177326 macosx-all,windows-all
java/awt/Mouse/EnterExitEvents/DragWindowOutOfFrameTest.java 8177326 macosx-all,windows-all,linux-all
java/awt/Mouse/EnterExitEvents/DragWindowTest.java 8023562 macosx-all,windows-all,linux-all
java/awt/Mouse/EnterExitEvents/ModalDialogEnterExitEventsTest.java JRE-898 macosx-all,windows-all,linux-all
java/awt/Mouse/EnterExitEvents/ResizingFrameTest.java 8005021 macosx-all,windows-all,linux-all
@@ -978,7 +978,7 @@ javax/swing/JMenuItem/4171437/bug4171437.java
javax/swing/JMenuItem/4654927/bug4654927.java 8172536 macosx-all,windows-all,linux-all
javax/swing/JMenuItem/6209975/bug6209975.java 8204062 macosx-all,windows-all
javax/swing/JMenuItem/6249972/bug6249972.java 8197552 macosx-all,windows-all,linux-all
javax/swing/JPopupMenu/4458079/bug4458079.java 8040917 macosx-all,windows-all
javax/swing/JPopupMenu/4458079/bug4458079.java 8040917 macosx-all,windows-all,linux-all
javax/swing/JPopupMenu/4769039/bug4769039.java 8194045 generic-all
javax/swing/JPopupMenu/4870644/bug4870644.java 8194130 macosx-all,linux-all
javax/swing/JPopupMenu/4966112/bug4966112.java 8064915,7151826 macosx-all,linux-all