Skip to content

Commit 60e9784

Browse files
author
Alexander Zvegintsev
committed
8354415: [Ubuntu25.04] api/java_awt/GraphicsDevice/indexTGF.html#SetDisplayMode - setDisplayMode_REFRESH_RATE_UNKNOWN fails: Height is different on vnc
Backport-of: 18c2e40de75f974858aeb453892e4c7c8d5aa90e
1 parent 4d5fb6e commit 60e9784

File tree

3 files changed

+353
-8
lines changed

3 files changed

+353
-8
lines changed

src/java.desktop/unix/classes/sun/awt/X11GraphicsDevice.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ depth, getConfigColormap(0, screen),
333333

334334
private static native void enterFullScreenExclusive(long window);
335335
private static native void exitFullScreenExclusive(long window);
336-
private static native boolean initXrandrExtension();
336+
private static native boolean initXrandrExtension(boolean useOldConfigDisplayMode);
337337
private static native DisplayMode getCurrentDisplayMode(int screen);
338338
private static native void enumDisplayModes(int screen,
339339
ArrayList<DisplayMode> modes);
@@ -350,10 +350,11 @@ private static native void configDisplayMode(int screen,
350350
*/
351351
private static synchronized boolean isXrandrExtensionSupported() {
352352
if (xrandrExtSupported == null) {
353-
xrandrExtSupported =
354-
Boolean.valueOf(initXrandrExtension());
353+
boolean useOldConfigDisplayMode =
354+
Boolean.getBoolean("awt.x11useOldConfigDisplayMode");
355+
xrandrExtSupported = initXrandrExtension(useOldConfigDisplayMode);
355356
}
356-
return xrandrExtSupported.booleanValue();
357+
return xrandrExtSupported;
357358
}
358359

359360
@Override

src/java.desktop/unix/native/common/awt/awt_GraphicsEnv.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,11 @@ struct X11GraphicsConfigIDs {
6262
jfieldID bitsPerPixel;
6363
};
6464

65+
#define MAX_DISPLAY_MODES 256
66+
typedef struct {
67+
unsigned int width;
68+
unsigned int height;
69+
jint refresh;
70+
} DisplayMode;
71+
6572
#endif /* _AWT_GRAPHICSENV_H_ */

0 commit comments

Comments
 (0)