8165705: Robot.createScreenCapture produces black screenshot on Oracle Linux 7.1
Reviewed-by: serb
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java Thu Jan 12 13:34:58 2017 -0800
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java Mon Jan 16 16:37:47 2017 +0300
@@ -27,7 +27,7 @@
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 @@
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;