src/macosx/native/sun/osxapp/NSApplicationAWT.m
Print this page
*** 50,60 ****
// Multiple Calls: NO
// Caller: +[NSApplication sharedApplication]
AWT_ASSERT_APPKIT_THREAD;
fApplicationName = nil;
- fUseDefaultIcon = NO;
// NSApplication will call _RegisterApplication with the application's bundle, but there may not be one.
// So, we need to call it ourselves to ensure the app is set up properly.
[self registerWithProcessManager];
--- 50,59 ----
*** 145,158 ****
snprintf(envVar, sizeof(envVar), "APP_NAME_%d", getpid());
char *appName = getenv(envVar);
if (appName != NULL) {
fApplicationName = [NSString stringWithUTF8String:appName];
unsetenv(envVar);
-
- // If this environment variable was set we were launched from the command line, so we
- // should use a generic app icon if one wasn't set.
- fUseDefaultIcon = YES;
}
// If it wasn't specified as an argument, see if it was specified as a system property.
if (fApplicationName == nil) {
fApplicationName = [PropertiesUtilities javaSystemPropertyForKey:@"apple.awt.application.name" withEnv:env];
--- 144,153 ----
*** 169,181 ****
NSRange lastPeriod = [fApplicationName rangeOfString:@"." options:NSBackwardsSearch];
if (lastPeriod.location != NSNotFound) {
fApplicationName = [fApplicationName substringFromIndex:lastPeriod.location + 1];
}
- // If this environment variable was set we were launched from the command line, so we
- // should use a generic app icon if one wasn't set.
- fUseDefaultIcon = YES;
}
}
// The dock name is nil for double-clickable Java apps (bundled and Web Start apps)
// When that happens get the display name, and if that's not available fall back to
--- 164,173 ----
*** 264,274 ****
}
// If the icon file wasn't specified as an argument and we need to get an icon
// we'll use the generic java app icon.
NSString *defaultIconPath = [NSString stringWithFormat:@"%@%@", SHARED_FRAMEWORK_BUNDLE, @"/Resources/GenericApp.icns"];
! if (fUseDefaultIcon && (theIconPath == nil)) {
theIconPath = defaultIconPath;
}
// Set up the dock icon if we have an icon name.
if (theIconPath != nil) {
--- 256,266 ----
}
// If the icon file wasn't specified as an argument and we need to get an icon
// we'll use the generic java app icon.
NSString *defaultIconPath = [NSString stringWithFormat:@"%@%@", SHARED_FRAMEWORK_BUNDLE, @"/Resources/GenericApp.icns"];
! if (([NSApp applicationIconImage] == nil) && (theIconPath == nil)) {
theIconPath = defaultIconPath;
}
// Set up the dock icon if we have an icon name.
if (theIconPath != nil) {