--- a/jdk/src/solaris/native/java/lang/java_props_macosx.c Thu Oct 24 20:46:23 2013 -0400
+++ b/jdk/src/solaris/native/java/lang/java_props_macosx.c Thu Oct 24 20:47:41 2013 -0400
@@ -105,40 +105,17 @@
}
}
-/* There are several toolkit options on Mac OS X, so we should try to
- * pick the "best" one, given what we know about the environment Java
- * is running under
- */
-
-static PreferredToolkit getPreferredToolkitFromEnv() {
- char *envVar = getenv("AWT_TOOLKIT");
- if (envVar == NULL) return unset;
-
- if (strcasecmp(envVar, "CToolkit") == 0) return CToolkit;
- if (strcasecmp(envVar, "XToolkit") == 0) return XToolkit;
- if (strcasecmp(envVar, "HToolkit") == 0) return HToolkit;
- return unset;
-}
-
-static bool isInAquaSession() {
+int isInAquaSession() {
// Is the WindowServer available?
SecuritySessionId session_id;
SessionAttributeBits session_info;
OSStatus status = SessionGetInfo(callerSecuritySession, &session_id, &session_info);
- if (status != noErr) return false;
- if (!(session_info & sessionHasGraphicAccess)) return false;
- return true;
-}
-
-PreferredToolkit getPreferredToolkit() {
- static PreferredToolkit pref = unset;
- if (pref != unset) return pref;
-
- PreferredToolkit prefFromEnv = getPreferredToolkitFromEnv();
- if (prefFromEnv != unset) return pref = prefFromEnv;
-
- if (isInAquaSession()) return pref = CToolkit;
- return pref = HToolkit;
+ if (status == noErr) {
+ if (session_info & sessionHasGraphicAccess) {
+ return 1;
+ }
+ }
+ return 0;
}
void setOSNameAndVersion(java_props_t *sprops) {