8165705: Robot.createScreenCapture produces black screenshot on Oracle Linux 7.1

Reviewed-by: serb
This commit is contained in:
Alexander Zvegintsev 2017-01-16 16:37:47 +03:00
parent 88abe0f2fc
commit 56e387c99e

View File

@ -27,7 +27,7 @@ package sun.awt.X11;
import java.awt.*;
import java.awt.peer.*;
import java.security.AccessController;
import java.security.PrivilegedAction;
import sun.security.action.GetPropertyAction;
import sun.awt.AWTAccessor;
import sun.awt.SunToolkit;
@ -40,11 +40,11 @@ class XRobotPeer implements RobotPeer {
static final boolean tryGtk;
static {
loadNativeLibraries();
tryGtk = AccessController.doPrivileged((PrivilegedAction<Boolean>)()
-> Boolean.getBoolean("awt.robot.gtk"));
tryGtk = Boolean.parseBoolean(
AccessController.doPrivileged(
new GetPropertyAction("awt.robot.gtk", "true")
));
}
private static boolean isGtkSupported = false;
private static volatile boolean useGtk;
private X11GraphicsConfig xgc = null;