|
53 | 53 | static BOOL isFullScreenExitingLoop = NO;
|
54 | 54 | static NSMutableDictionary * keyCodeForCharMap = nil;
|
55 | 55 | static BOOL isEmbedded = NO;
|
56 |
| -static BOOL isNormalTaskbarApp = NO; |
| 56 | +static BOOL triggerReactivation = NO; |
57 | 57 | static BOOL disableSyncRendering = NO;
|
58 | 58 | static BOOL firstActivation = YES;
|
59 | 59 | static BOOL shouldReactivate = NO;
|
@@ -265,7 +265,7 @@ - (void)applicationDidBecomeActive:(NSNotification *)aNotification
|
265 | 265 | [pool drain];
|
266 | 266 | GLASS_CHECK_EXCEPTION(env);
|
267 | 267 |
|
268 |
| - if (isNormalTaskbarApp && firstActivation) { |
| 268 | + if (triggerReactivation && firstActivation) { |
269 | 269 | LOG("-> deactivate (hide) app");
|
270 | 270 | firstActivation = NO;
|
271 | 271 | shouldReactivate = YES;
|
@@ -298,7 +298,7 @@ - (void)applicationDidResignActive:(NSNotification *)aNotification
|
298 | 298 | [pool drain];
|
299 | 299 | GLASS_CHECK_EXCEPTION(env);
|
300 | 300 |
|
301 |
| - if (isNormalTaskbarApp && shouldReactivate) { |
| 301 | + if (triggerReactivation && shouldReactivate) { |
302 | 302 | LOG("-> reactivate app");
|
303 | 303 | shouldReactivate = NO;
|
304 | 304 | [NSApp activateIgnoringOtherApps:YES];
|
@@ -530,7 +530,16 @@ - (void)runLoop:(id)selector
|
530 | 530 | }
|
531 | 531 | if (self->jTaskBarApp == JNI_TRUE)
|
532 | 532 | {
|
533 |
| - isNormalTaskbarApp = YES; |
| 533 | + triggerReactivation = YES; |
| 534 | + |
| 535 | + // The workaround of deactivating and reactivating |
| 536 | + // the application so that the system menu bar works |
| 537 | + // correctly is no longer needed (and no longer works |
| 538 | + // anyway) as of macOS 14 |
| 539 | + if (@available(macOS 14.0, *)) { |
| 540 | + triggerReactivation = NO; |
| 541 | + } |
| 542 | + |
534 | 543 | // move process from background only to full on app with visible Dock icon
|
535 | 544 | ProcessSerialNumber psn;
|
536 | 545 | if (GetCurrentProcess(&psn) == noErr)
|
@@ -1060,14 +1069,14 @@ + (BOOL)syncRenderingDisabled {
|
1060 | 1069 |
|
1061 | 1070 | /*
|
1062 | 1071 | * Class: com_sun_glass_ui_mac_MacApplication
|
1063 |
| - * Method: _isNormalTaskbarApp |
| 1072 | + * Method: _isTriggerReactivation |
1064 | 1073 | * Signature: ()Z;
|
1065 | 1074 | */
|
1066 |
| -JNIEXPORT jboolean JNICALL Java_com_sun_glass_ui_mac_MacApplication__1isNormalTaskbarApp |
| 1075 | +JNIEXPORT jboolean JNICALL Java_com_sun_glass_ui_mac_MacApplication__1isTriggerReactivation |
1067 | 1076 | (JNIEnv *env, jobject japplication)
|
1068 | 1077 | {
|
1069 |
| - LOG("Java_com_sun_glass_ui_mac_MacApplication__1isNormalTaskbarApp"); |
1070 |
| - return isNormalTaskbarApp; |
| 1078 | + LOG("Java_com_sun_glass_ui_mac_MacApplication__1isTriggerReactivation"); |
| 1079 | + return triggerReactivation; |
1071 | 1080 | }
|
1072 | 1081 |
|
1073 | 1082 | /*
|
|
0 commit comments