# HG changeset patch # User prr # Date 1556928402 25200 # Node ID 72d1941298031cebf4286f7fdc8a007a09c4685c # Parent 88b769ae99c7990180e6fcebb6cec22e84faa430 8222819: Remove setting of headless property on MacOS from launcher code. Reviewed-by: serb, rriggs diff -r 88b769ae99c7 -r 72d194129803 src/java.base/macosx/native/libjava/java_props_macosx.c --- a/src/java.base/macosx/native/libjava/java_props_macosx.c Thu May 02 10:48:56 2019 -0700 +++ b/src/java.base/macosx/native/libjava/java_props_macosx.c Fri May 03 17:06:42 2019 -0700 @@ -212,25 +212,6 @@ } } -int isInAquaSession() { - // environment variable to bypass the aqua session check - char *ev = getenv("AWT_FORCE_HEADFUL"); - if (ev && (strncasecmp(ev, "true", 4) == 0)) { - // if "true" then tell the caller we're in an Aqua session without actually checking - return 1; - } - // Is the WindowServer available? - SecuritySessionId session_id; - SessionAttributeBits session_info; - OSStatus status = SessionGetInfo(callerSecuritySession, &session_id, &session_info); - if (status == noErr) { - if (session_info & sessionHasGraphicAccess) { - return 1; - } - } - return 0; -} - // 10.9 SDK does not include the NSOperatingSystemVersion struct. // For now, create our own typedef struct { diff -r 88b769ae99c7 -r 72d194129803 src/java.base/macosx/native/libjava/java_props_macosx.h --- a/src/java.base/macosx/native/libjava/java_props_macosx.h Thu May 02 10:48:56 2019 -0700 +++ b/src/java.base/macosx/native/libjava/java_props_macosx.h Fri May 03 17:06:42 2019 -0700 @@ -30,4 +30,3 @@ void setOSNameAndVersion(java_props_t *sprops); void setUserHome(java_props_t *sprops); void setProxyProperties(java_props_t *sProps); -int isInAquaSession(); diff -r 88b769ae99c7 -r 72d194129803 src/java.base/share/classes/jdk/internal/util/SystemProps.java --- a/src/java.base/share/classes/jdk/internal/util/SystemProps.java Thu May 02 10:48:56 2019 -0700 +++ b/src/java.base/share/classes/jdk/internal/util/SystemProps.java Fri May 03 17:06:42 2019 -0700 @@ -91,7 +91,6 @@ putIfAbsent(props, "ftp.nonProxyHosts", raw.propDefault(Raw._ftp_nonProxyHosts_NDX)); putIfAbsent(props, "socksNonProxyHosts", raw.propDefault(Raw._socksNonProxyHosts_NDX)); putIfAbsent(props, "awt.toolkit", raw.propDefault(Raw._awt_toolkit_NDX)); - putIfAbsent(props, "java.awt.headless", raw.propDefault(Raw._java_awt_headless_NDX)); putIfAbsent(props, "sun.arch.abi", raw.propDefault(Raw._sun_arch_abi_NDX)); putIfAbsent(props, "sun.arch.data.model", raw.propDefault(Raw._sun_arch_data_model_NDX)); putIfAbsent(props, "sun.os.patch.level", raw.propDefault(Raw._sun_os_patch_level_NDX)); @@ -205,8 +204,7 @@ @Native private static final int _http_proxyPort_NDX = 1 + _http_proxyHost_NDX; @Native private static final int _https_proxyHost_NDX = 1 + _http_proxyPort_NDX; @Native private static final int _https_proxyPort_NDX = 1 + _https_proxyHost_NDX; - @Native private static final int _java_awt_headless_NDX = 1 + _https_proxyPort_NDX; - @Native private static final int _java_io_tmpdir_NDX = 1 + _java_awt_headless_NDX; + @Native private static final int _java_io_tmpdir_NDX = 1 + _https_proxyPort_NDX; @Native private static final int _line_separator_NDX = 1 + _java_io_tmpdir_NDX; @Native private static final int _os_arch_NDX = 1 + _line_separator_NDX; @Native private static final int _os_name_NDX = 1 + _os_arch_NDX; diff -r 88b769ae99c7 -r 72d194129803 src/java.base/share/native/libjava/System.c --- a/src/java.base/share/native/libjava/System.c Thu May 02 10:48:56 2019 -0700 +++ b/src/java.base/share/native/libjava/System.c Fri May 03 17:06:42 2019 -0700 @@ -161,8 +161,6 @@ PUTPROP(propArray, _sun_cpu_isalist_NDX, sprops->cpu_isalist); #ifdef MACOSX - PUTPROP(propArray, _java_awt_headless_NDX, sprops->awt_headless); - /* Proxy setting properties */ if (sprops->httpProxyEnabled) { PUTPROP(propArray, _http_proxyHost_NDX, sprops->httpHost); diff -r 88b769ae99c7 -r 72d194129803 src/java.base/share/native/libjava/java_props.h --- a/src/java.base/share/native/libjava/java_props.h Thu May 02 10:48:56 2019 -0700 +++ b/src/java.base/share/native/libjava/java_props.h Fri May 03 17:06:42 2019 -0700 @@ -102,8 +102,6 @@ char *socksPort; char *exceptionList; - - char *awt_headless; /* java.awt.headless setting, if NULL (default) will not be set */ #endif } java_props_t; diff -r 88b769ae99c7 -r 72d194129803 src/java.base/unix/native/libjava/java_props_md.c --- a/src/java.base/unix/native/libjava/java_props_md.c Thu May 02 10:48:56 2019 -0700 +++ b/src/java.base/unix/native/libjava/java_props_md.c Fri May 03 17:06:42 2019 -0700 @@ -398,9 +398,6 @@ #ifdef MACOSX // Always the same Toolkit on Mac OS X sprops.awt_toolkit = "sun.lwawt.macosx.LWCToolkit"; - - // check if we're in a GUI login session and set java.awt.headless=true if not - sprops.awt_headless = isInAquaSession() ? NULL : "true"; #else sprops.awt_toolkit = "sun.awt.X11.XToolkit"; #endif