src/macosx/native/sun/awt/ApplicationDelegate.m
Print this page
*** 101,110 ****
--- 101,111 ----
@synthesize fPreferencesMenu;
@synthesize fAboutMenu;
@synthesize fDockMenu;
@synthesize fDefaultMenuBar;
+ @synthesize isAppActive;
+ (ApplicationDelegate *)sharedDelegate {
static ApplicationDelegate *sApplicationDelegate = nil;
static BOOL checked = NO;
*** 226,235 ****
--- 227,237 ----
BOOL aboutAvailable = ([self.fAboutMenu menu] != nil);
BOOL aboutEnabled = (aboutAvailable && [self.fAboutMenu isEnabled] && ([self.fAboutMenu target] != nil));
BOOL prefsAvailable = ([self.fPreferencesMenu menu] != nil);
BOOL prefsEnabled = (prefsAvailable && [self.fPreferencesMenu isEnabled] && ([self.fPreferencesMenu target] != nil));
+ isAppActive = NO;
JNIEnv *env = [ThreadUtilities getJNIEnv];
static JNF_CLASS_CACHE(sjc_AppMenuBarHandler, "com/apple/eawt/_AppMenuBarHandler");
static JNF_STATIC_MEMBER_CACHE(sjm_initMenuStates, sjc_AppMenuBarHandler, "initMenuStates", "(ZZZZ)V");
JNFCallStaticVoidMethod(env, sjm_initMenuStates, aboutAvailable, aboutEnabled, prefsAvailable, prefsEnabled);
*** 498,507 ****
--- 500,517 ----
[image unlockFocus];
[image autorelease];
return image;
}
+ - (void)applicationWillBecomeActive:(id)application {
+ isAppActive = YES;
+ }
+
+ - (void)applicationWillResignActive:(id)application {
+ isAppActive = NO;
+ }
+
@end
#pragma mark Native JNI calls