--- old/src/java.desktop/macosx/native/libawt_lwawt/awt/ApplicationDelegate.m 2018-08-22 12:15:53.000000000 -0700 +++ new/src/java.desktop/macosx/native/libawt_lwawt/awt/ApplicationDelegate.m 2018-08-22 12:15:52.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,10 +35,10 @@ #import #import "CPopupMenu.h" +#import "CMenuBar.h" #import "ThreadUtilities.h" #import "NSApplicationAWT.h" - #pragma mark App Menu helpers // The following is a AWT convention? @@ -201,11 +201,11 @@ self.fPreferencesMenu = (NSMenuItem*)[appMenu itemWithTag:PREFERENCES_TAG]; self.fAboutMenu = (NSMenuItem*)[appMenu itemAtIndex:0]; - + NSDockTile *dockTile = [NSApp dockTile]; self.fProgressIndicator = [[NSProgressIndicator alloc] initWithFrame:NSMakeRect(3.f, 0.f, dockTile.size.width - 6.f, 20.f)]; - + [fProgressIndicator setStyle:NSProgressIndicatorBarStyle]; [fProgressIndicator setIndeterminate:NO]; [[dockTile contentView] addSubview:fProgressIndicator]; @@ -824,3 +824,23 @@ JNF_COCOA_EXIT(env); } + +/* + * Class: com_apple_eawt__AppMenuBarHandler + * Method: nativeActivateDefaultMenuBar + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMenuBarHandler_nativeActivateDefaultMenuBar +(JNIEnv *env, jclass clz, jlong cMenuBarPtr) +{ +JNF_COCOA_ENTER(env); + + CMenuBar *menu = (CMenuBar *)jlong_to_ptr(cMenuBarPtr); + [ThreadUtilities performOnMainThreadWaiting:NO block:^(){ + if (menu) { + [CMenuBar activate:menu modallyDisabled:NO]; + } + }]; + +JNF_COCOA_EXIT(env); +}