Backport: Fix Emacs not gaining focus when launched on macOS

* src/nsterm.m (ns_term_init): Activate after calling run, not before;
remove outdated comment (bug#81683, bug#76814).

Copyright-paperwork-exempt: yes
(cherry picked from commit cc15723d21)
This commit is contained in:
Perry Fraser 2026-08-22 16:56:23 -04:00 committed by Sean Whitton
parent dbd3088c10
commit 478dcbc17e

View file

@ -6134,13 +6134,15 @@ Needs to be here because ns_initialize_display_info () uses AppKit classes.
#endif
NSPasteboardTypeURL, nil] retain];
/* If fullscreen is in init/default-frame-alist, focus isn't set
right for fullscreen windows, so set this. */
[NSApp activateIgnoringOtherApps:YES];
NSTRACE_MSG ("Call NSApp run");
[NSApp run];
#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 140000
[NSApp activate];
#else
[NSApp activateIgnoringOtherApps:YES];
#endif
ns_do_open_file = YES;
#ifdef NS_IMPL_GNUSTEP