Fix macOS 26 (Tahoe) scrolling lag and input handling issues

macOS 26 introduced new event processing behavior that causes scrolling
lag and input handling problems in Emacs.  This patch disables two
features via NSUserDefaults when built against the macOS 26 SDK:
- NSEventConcurrentProcessingEnabled
- NSApplicationUpdateCycleEnabled
This fix is based on the equivalent patch in emacs-mac by Mitsuharu
Yamamoto.  See: https://bitbucket.org/mituharu/emacs-mac/commits/e52ebfd
* src/nsterm.m (ns_term_init): Disable problematic event processing
when built for macOS 26+.  (Bug#80268)
This commit is contained in:
Boris Buliga
2026-01-31 12:18:08 +02:00
committed by Eli Zaretskii
parent 049eefa611
commit 046f5ef018

View File

@@ -5838,6 +5838,15 @@ ns_term_init (Lisp_Object display_name)
ns_pending_service_names = [[NSMutableArray alloc] init];
ns_pending_service_args = [[NSMutableArray alloc] init];
#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 260000
/* Disable problematic event processing on macOS 26 (Tahoe) to avoid
scrolling lag and input handling issues. These are undocumented
options as of macOS 26.0. */
[NSUserDefaults.standardUserDefaults
registerDefaults:@{@"NSEventConcurrentProcessingEnabled" : @"NO",
@"NSApplicationUpdateCycleEnabled" : @"NO"}];
#endif
/* Start app and create the main menu, window, view.
Needs to be here because ns_initialize_display_info () uses AppKit classes.
The view will then ask the NSApp to stop and return to Emacs. */