changeset 16525:1089d8a8a6e1

8165705: Robot.createScreenCapture produces black screenshot on Oracle Linux 7.1 Reviewed-by: serb
author azvegint
date Mon, 16 Jan 2017 16:37:47 +0300
parents ff658d8ed23a
children 29c8fe4936fc
files src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java	Thu Jan 12 13:34:58 2017 -0800
+++ b/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;