From 046f5ef018997e8ef60d2157864ed7d02934d81f Mon Sep 17 00:00:00 2001 From: Boris Buliga Date: Sat, 31 Jan 2026 12:18:08 +0200 Subject: [PATCH] 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) --- src/nsterm.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/nsterm.m b/src/nsterm.m index ca06195a798..c852b70be74 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -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. */