52 * @see GraphicsConfiguration 53 */ 54 public final class X11GraphicsDevice extends GraphicsDevice 55 implements DisplayChangedListener { 56 int screen; 57 HashMap<SurfaceType, Object> x11ProxyKeyMap = new HashMap<>(); 58 59 private static AWTPermission fullScreenExclusivePermission; 60 private static Boolean xrandrExtSupported; 61 private final Object configLock = new Object(); 62 private SunDisplayChanger topLevels = new SunDisplayChanger(); 63 private DisplayMode origDisplayMode; 64 private boolean shutdownHookRegistered; 65 private int scale; 66 67 public X11GraphicsDevice(int screennum) { 68 this.screen = screennum; 69 this.scale = initScaleFactor(); 70 } 71 72 /* 73 * Initialize JNI field and method IDs for fields that may be 74 * accessed from C. 75 */ 76 private static native void initIDs(); 77 78 /** 79 * Returns the X11 screen of the device. 80 */ 81 public int getScreen() { 82 return screen; 83 } 84 85 public Object getProxyKeyFor(SurfaceType st) { 86 synchronized (x11ProxyKeyMap) { 87 Object o = x11ProxyKeyMap.get(st); 88 if (o == null) { 89 o = new Object(); 90 x11ProxyKeyMap.put(st, o); 91 } 92 return o; 93 } 94 } 95 96 /** 97 * Returns the X11 Display of this device. | 52 * @see GraphicsConfiguration 53 */ 54 public final class X11GraphicsDevice extends GraphicsDevice 55 implements DisplayChangedListener { 56 int screen; 57 HashMap<SurfaceType, Object> x11ProxyKeyMap = new HashMap<>(); 58 59 private static AWTPermission fullScreenExclusivePermission; 60 private static Boolean xrandrExtSupported; 61 private final Object configLock = new Object(); 62 private SunDisplayChanger topLevels = new SunDisplayChanger(); 63 private DisplayMode origDisplayMode; 64 private boolean shutdownHookRegistered; 65 private int scale; 66 67 public X11GraphicsDevice(int screennum) { 68 this.screen = screennum; 69 this.scale = initScaleFactor(); 70 } 71 72 /** 73 * Returns the X11 screen of the device. 74 */ 75 public int getScreen() { 76 return screen; 77 } 78 79 public Object getProxyKeyFor(SurfaceType st) { 80 synchronized (x11ProxyKeyMap) { 81 Object o = x11ProxyKeyMap.get(st); 82 if (o == null) { 83 o = new Object(); 84 x11ProxyKeyMap.put(st, o); 85 } 86 return o; 87 } 88 } 89 90 /** 91 * Returns the X11 Display of this device. |