Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
8214343: Handle the absence of Xrandr more generically
Browse files Browse the repository at this point in the history
Reviewed-by: stuefe, erikj, prr
  • Loading branch information
simonis committed Nov 28, 2018
1 parent bc98309 commit 631decb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
4 changes: 3 additions & 1 deletion make/autoconf/lib-x11.m4
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
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
Expand Down
18 changes: 9 additions & 9 deletions src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#ifndef HEADLESS
#include <X11/extensions/Xdbe.h>
#include <X11/XKBlib.h>
#ifndef _AIX
#ifndef NO_XRANDR
#include <X11/extensions/Xrandr.h>
#endif
#include "GLXGraphicsConfig.h"
Expand Down Expand Up @@ -1627,7 +1627,7 @@ Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterPoint(JNIEnv *env,

#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
Expand Down Expand Up @@ -1834,7 +1834,7 @@ X11GD_AddDisplayMode(JNIEnv *env, jobject arrayList,
}
}

#endif /* !_AIX */
#endif /* !NO_XRANDR */

static void
X11GD_SetFullscreenMode(Window win, jboolean enabled)
Expand Down Expand Up @@ -1875,7 +1875,7 @@ JNIEXPORT jboolean JNICALL
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;
Expand All @@ -1902,7 +1902,7 @@ JNIEXPORT jobject JNICALL
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;
Expand Down Expand Up @@ -1998,7 +1998,7 @@ Java_sun_awt_X11GraphicsDevice_enumDisplayModes
(JNIEnv* env, jclass x11gd,
jint screen, jobject arrayList)
{
#if !defined(HEADLESS) && !defined(_AIX)
#if !defined(HEADLESS) && !defined(NO_XRANDR)

AWT_LOCK();

Expand Down Expand Up @@ -2086,7 +2086,7 @@ Java_sun_awt_X11GraphicsDevice_configDisplayMode
(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;
Expand Down Expand Up @@ -2203,7 +2203,7 @@ Java_sun_awt_X11GraphicsDevice_exitFullScreenExclusive
*/

static char *get_output_screen_name(JNIEnv *env, int screen) {
#ifdef _AIX
#ifdef NO_XRANDR
return NULL;
#else
if (!awt_XRRGetScreenResources || !awt_XRRGetOutputInfo) {
Expand Down Expand Up @@ -2235,7 +2235,7 @@ static char *get_output_screen_name(JNIEnv *env, int screen) {
}
AWT_UNLOCK();
return name;
#endif /* _AIX */
#endif /* NO_XRANDR */
}

/*
Expand Down

0 comments on commit 631decb

Please sign in to comment.