< prev index next >
src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -23,43 +23,37 @@
* questions.
*/
package sun.awt.X11;
-import java.awt.GraphicsConfiguration;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.peer.RobotPeer;
import java.security.AccessController;
import sun.awt.AWTAccessor;
import sun.awt.SunToolkit;
import sun.awt.UNIXToolkit;
import sun.awt.X11GraphicsConfig;
+import sun.awt.X11GraphicsDevice;
import sun.security.action.GetPropertyAction;
final class XRobotPeer implements RobotPeer {
- static final boolean tryGtk;
+ private static final boolean tryGtk;
static {
loadNativeLibraries();
tryGtk = Boolean.parseBoolean(
AccessController.doPrivileged(
new GetPropertyAction("awt.robot.gtk", "true")
));
}
private static volatile boolean useGtk;
- private X11GraphicsConfig xgc = null;
+ private final X11GraphicsConfig xgc;
- /*
- * native implementation uses some static shared data (pipes, processes)
- * so use a class lock to synchronize native method calls
- */
- static Object robotLock = new Object();
-
- XRobotPeer(GraphicsConfiguration gc) {
- this.xgc = (X11GraphicsConfig)gc;
+ XRobotPeer(X11GraphicsDevice gd) {
+ xgc = (X11GraphicsConfig) gd.getDefaultConfiguration();
SunToolkit tk = (SunToolkit)Toolkit.getDefaultToolkit();
setup(tk.getNumberOfButtons(),
AWTAccessor.getInputEventAccessor().getButtonDownMasks());
boolean isGtkSupported = false;
< prev index next >