# HG changeset patch # User simonis # Date 1543325975 -3600 # Tue Nov 27 14:39:35 2018 +0100 # Node ID 5db3e7aa81193c9a9bd163f6e966acd065a7a2c7 # Parent 61dcd7cd48c390bb0262767e462db14a517d37c9 8214343: Handle the absence of Xrandr more generically Reviewed-by: diff --git a/make/autoconf/lib-x11.m4 b/make/autoconf/lib-x11.m4 --- a/make/autoconf/lib-x11.m4 +++ b/make/autoconf/lib-x11.m4 @@ -101,7 +101,9 @@ HEADERS_TO_CHECK="X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h" # There is no Xrandr extension on AIX - if test "x$OPENJDK_TARGET_OS" != xaix; then + if test "x$OPENJDK_TARGET_OS" = xaix; then + X_CFLAGS="$X_CFLAGS -DNO_XRANDR" + else HEADERS_TO_CHECK="$HEADERS_TO_CHECK X11/extensions/Xrandr.h" fi diff --git a/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c b/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c --- a/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c +++ b/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c @@ -34,7 +34,7 @@ #ifndef HEADLESS #include #include -#ifndef _AIX +#ifndef NO_XRANDR #include #endif #include "GLXGraphicsConfig.h" @@ -1627,7 +1627,7 @@ #ifndef HEADLESS -#ifndef _AIX +#ifndef NO_XRANDR #define BIT_DEPTH_MULTI java_awt_DisplayMode_BIT_DEPTH_MULTI #define REFRESH_RATE_UNKNOWN java_awt_DisplayMode_REFRESH_RATE_UNKNOWN @@ -1834,7 +1834,7 @@ } } -#endif /* !_AIX */ +#endif /* !NO_XRANDR */ static void X11GD_SetFullscreenMode(Window win, jboolean enabled) @@ -1875,7 +1875,7 @@ Java_sun_awt_X11GraphicsDevice_initXrandrExtension (JNIEnv *env, jclass x11gd) { -#if defined(HEADLESS) || defined(_AIX) +#if defined(HEADLESS) || defined(NO_XRANDR) return JNI_FALSE; #else int opcode = 0, firstEvent = 0, firstError = 0; @@ -1902,7 +1902,7 @@ Java_sun_awt_X11GraphicsDevice_getCurrentDisplayMode (JNIEnv* env, jclass x11gd, jint screen) { -#if defined(HEADLESS) || defined(_AIX) +#if defined(HEADLESS) || defined(NO_XRANDR) return NULL; #else XRRScreenConfiguration *config; @@ -1998,7 +1998,7 @@ (JNIEnv* env, jclass x11gd, jint screen, jobject arrayList) { -#if !defined(HEADLESS) && !defined(_AIX) +#if !defined(HEADLESS) && !defined(NO_XRANDR) AWT_LOCK(); @@ -2086,7 +2086,7 @@ (JNIEnv* env, jclass x11gd, jint screen, jint width, jint height, jint refreshRate) { -#if !defined(HEADLESS) && !defined(_AIX) +#if !defined(HEADLESS) && !defined(NO_XRANDR) jboolean success = JNI_FALSE; XRRScreenConfiguration *config; Drawable root; @@ -2203,7 +2203,7 @@ */ static char *get_output_screen_name(JNIEnv *env, int screen) { -#ifdef _AIX +#ifdef NO_XRANDR return NULL; #else if (!awt_XRRGetScreenResources || !awt_XRRGetOutputInfo) { @@ -2235,7 +2235,7 @@ } AWT_UNLOCK(); return name; -#endif /* _AIX */ +#endif /* NO_XRANDR */ } /*