Compare commits

...

2 Commits
1825 ... 1692

Author SHA1 Message Date
Vitaly Provodin
f950ff463c a11y: exclude tests crashing JBR in the runs with enabled Voice Over 2021-10-01 10:40:34 +07:00
Mikhail Grishchenko
cf2f09827c Revert "JBR-3688 PyCharm incredibly slow with fakexrandr"
This reverts commit accef6f21e.
2021-09-27 05:53:55 +07:00
4 changed files with 31 additions and 65 deletions

View File

@@ -119,7 +119,6 @@ import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Hashtable;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
@@ -654,15 +653,9 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
((X11GraphicsEnvironment)GraphicsEnvironment.
getLocalGraphicsEnvironment()).
rebuildDevices();
if (useCachedInsets) resetScreenInsetsCache();
} finally {
awtLock();
}
} else if (useCachedInsets) {
final XAtom XA_NET_WORKAREA = XAtom.get("_NET_WORKAREA");
final boolean rootWindowWorkareaResized = (ev.get_type() == XConstants.PropertyNotify
&& ev.get_xproperty().get_atom() == XA_NET_WORKAREA.getAtom());
if (rootWindowWorkareaResized) resetScreenInsetsCache();
}
});
} finally {
@@ -1167,7 +1160,8 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
* When two screens overlap and the first contains a dock(*****), then
* _NET_WORKAREA may start at point x1,y1 and end at point x2,y2.
*/
private Insets getScreenInsetsImpl(final GraphicsConfiguration gc) {
@Override
public Insets getScreenInsets(final GraphicsConfiguration gc) {
GraphicsDevice gd = gc.getDevice();
XNETProtocol np = XWM.getWM().getNETProtocol();
if (np == null || !(gd instanceof X11GraphicsDevice) || !np.active()) {
@@ -1211,20 +1205,6 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
}
}
private final Hashtable<GraphicsConfiguration, Insets> cachedInsets = new Hashtable<>();
private void resetScreenInsetsCache() {
cachedInsets.clear();
}
@Override
public Insets getScreenInsets(final GraphicsConfiguration gc) {
if (useCachedInsets) {
return cachedInsets.computeIfAbsent(gc, this::getScreenInsetsImpl);
} else {
return getScreenInsetsImpl(gc);
}
}
/**
* Returns the value of "sun.awt.X11.checkSTRUT" property. Default value is
* {@code false}.
@@ -3111,7 +3091,4 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
public static boolean getSunAwtDisableGrab() {
return AccessController.doPrivileged(new GetBooleanAction("sun.awt.disablegrab"));
}
private static final boolean useCachedInsets = Boolean.parseBoolean(AccessController.doPrivileged(
new GetPropertyAction("x11.cache.screen.insets", "true")));
}

View File

@@ -46,7 +46,6 @@ import sun.java2d.loops.SurfaceType;
import sun.awt.util.ThreadGroupUtils;
import sun.java2d.SunGraphicsEnvironment;
import sun.security.action.GetPropertyAction;
/**
* This is an implementation of a GraphicsDevice object for a single
@@ -146,7 +145,7 @@ public final class X11GraphicsDevice extends GraphicsDevice
return Region.clipRound(x / (double)getScaleFactor());
}
private Rectangle getBoundsImpl() {
public Rectangle getBounds() {
Rectangle rect = pGetBounds(getScreen());
if (getScaleFactor() != 1) {
rect.x = scaleDown(rect.x);
@@ -157,28 +156,6 @@ public final class X11GraphicsDevice extends GraphicsDevice
return rect;
}
private Rectangle boundsCached;
private synchronized Rectangle getBoundsCached() {
if (boundsCached == null) {
boundsCached = getBoundsImpl();
}
return boundsCached;
}
public synchronized void resetBoundsCache() {
boundsCached = null;
}
public Rectangle getBounds() {
if (X11GraphicsEnvironment.useBoundsCache()) {
return getBoundsCached();
}
else {
return getBoundsImpl();
}
}
/**
* Returns the identification string associated with this graphics
* device.
@@ -656,6 +633,5 @@ public final class X11GraphicsDevice extends GraphicsDevice
public void invalidate(X11GraphicsDevice device) {
screen = device.screen;
if (X11GraphicsEnvironment.useBoundsCache()) resetBoundsCache();
}
}

View File

@@ -35,13 +35,11 @@ import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.security.AccessController;
import java.util.*;
import sun.awt.X11.XToolkit;
import sun.java2d.SunGraphicsEnvironment;
import sun.java2d.SurfaceManagerFactory;
import sun.java2d.UnixSurfaceManagerFactory;
import sun.security.action.GetPropertyAction;
import sun.util.logging.PlatformLogger;
import sun.java2d.xr.XRSurfaceData;
@@ -257,12 +255,6 @@ public final class X11GraphicsEnvironment extends SunGraphicsEnvironment {
it.remove();
}
}
if (useBoundsCache()) {
for (final X11GraphicsDevice gd : devices.values()) {
gd.resetBoundsCache();
}
}
}
@Override
@@ -512,11 +504,4 @@ public final class X11GraphicsEnvironment extends SunGraphicsEnvironment {
@Override
public void paletteChanged() {
}
private static final boolean cacheScreenBoundsValue = Boolean.parseBoolean(AccessController.doPrivileged(
new GetPropertyAction("x11.cache.screen.bounds", "true")));
public static boolean useBoundsCache() {
return cacheScreenBoundsValue;
}
}

View File

@@ -0,0 +1,28 @@
java/awt/Focus/ModalDialogInitialFocusTest/ModalDialogInitialFocusTest.java JBR-3730 macosx-all
java/awt/Choice/UnfocusableCB_ERR/UnfocusableCB_ERR.java JBR-3730 macosx-all
java/awt/Component/7097771/bug7097771.java JBR-3730 macosx-all
java/awt/Component/NoUpdateUponShow/NoUpdateUponShow.java JBR-3730 macosx-all
java/awt/Component/PaintAll/PaintAll.java JBR-3730 macosx-all
java/awt/Focus/DisposedWindow/DisposeDialogNotActivateOwnerTest/DisposeDialogNotActivateOwnerTest.java JBR-3730 macosx-all
java/awt/Focus/ModalDialogInitialFocusTest/ModalDialogInitialFocusTest.html JBR-3730 macosx-all
java/awt/Focus/NonFocusableWindowTest/NoEventsTest.java JBR-3730 macosx-all
java/awt/Focus/RemoveAfterRequest/RemoveAfterRequest.java JBR-3730 macosx-all
java/awt/Focus/RequestFocusAndHideTest/RequestFocusAndHideTest.java JBR-3730 macosx-all
java/awt/Focus/RequestOnCompWithNullParent/RequestOnCompWithNullParent1.java JBR-3730 macosx-all
java/awt/Focus/RestoreFocusOnDisabledComponentTest/RestoreFocusOnDisabledComponentTest.java JBR-3730 macosx-all
java/awt/Frame/ObscuredFrame/ObscuredFrameTest.java JBR-3730 macosx-all
java/awt/Focus/WindowIsFocusableAccessByThreadsTest/WindowIsFocusableAccessByThreadsTest.java JBR-3730 macosx-all
java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java JBR-3730 macosx-all
java/awt/Frame/MiscUndecorated/FrameCloseTest.java JBR-3733 macosx-all
java/awt/Frame/ObscuredFrame/ObscuredFrameTest.java JBR-3730 macosx-all
java/awt/Frame/ResizeAfterSetFont/ResizeAfterSetFont.java JBR-3730 macosx-all
java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogTest/EnqueueWithDialogTest.java JBR-3730 macosx-all
java/awt/Mixing/Validating.java JBR-3730 macosx-all
java/awt/Mixing/ValidBounds.java JBR-3730 macosx-all
java/awt/MouseAdapter/MouseAdapterUnitTest/MouseAdapterUnitTest.java JBR-3730 macosx-all
java/awt/print/PaintSetEnabledDeadlock/PaintSetEnabledDeadlock.java JBR-3730 macosx-all
java/awt/event/ComponentEvent/MovedResizedTwiceTest/MovedResizedTwiceTest.java JBR-3730 macosx-all
java/awt/event/MouseEvent/EnterAsGrabbedEvent/EnterAsGrabbedEvent.java JBR-3730 macosx-all
java/awt/event/MouseEvent/FrameMouseEventAbsoluteCoordsTest/FrameMouseEventAbsoluteCoordsTest.html JBR-3730 macosx-all
java/awt/event/MouseEvent/MouseButtonsTest/MouseButtonsTest.java JBR-3730 macosx-all
java/awt/event/MouseEvent/MultipleMouseButtonsTest/MultipleMouseButtonsTest.java JBR-3730 macosx-all