diff --git a/crates/gpui/src/platform/mac/window.rs b/crates/gpui/src/platform/mac/window.rs index 1230a704062ba835bceb5db5d2ecf05b688e34df..146b97856344757b332c5133b924c96d649f99ca 100644 --- a/crates/gpui/src/platform/mac/window.rs +++ b/crates/gpui/src/platform/mac/window.rs @@ -249,6 +249,37 @@ unsafe fn build_classes() { sel!(characterIndexForPoint:), character_index_for_point as extern "C" fn(&Object, Sel, NSPoint) -> u64, ); + + // Disable automatic text substitutions and services, which cause + // performance issues by constantly running heuristics on macOS 26. + decl.add_method( + sel!(isAutomaticTextCompletionEnabled), + no as extern "C" fn(&Object, Sel) -> BOOL, + ); + decl.add_method( + sel!(isAutomaticQuoteSubstitutionEnabled), + no as extern "C" fn(&Object, Sel) -> BOOL, + ); + decl.add_method( + sel!(isAutomaticDashSubstitutionEnabled), + no as extern "C" fn(&Object, Sel) -> BOOL, + ); + decl.add_method( + sel!(isAutomaticLinkDetectionEnabled), + no as extern "C" fn(&Object, Sel) -> BOOL, + ); + decl.add_method( + sel!(isAutomaticDataDetectionEnabled), + no as extern "C" fn(&Object, Sel) -> BOOL, + ); + decl.add_method( + sel!(isAutomaticSpellingCorrectionEnabled), + no as extern "C" fn(&Object, Sel) -> BOOL, + ); + decl.add_method( + sel!(isAutomaticTextReplacementEnabled), + no as extern "C" fn(&Object, Sel) -> BOOL, + ); } decl.register() }; @@ -1600,6 +1631,10 @@ extern "C" fn yes(_: &Object, _: Sel) -> BOOL { YES } +extern "C" fn no(_: &Object, _: Sel) -> BOOL { + NO +} + extern "C" fn dealloc_window(this: &Object, _: Sel) { unsafe { drop_window_state(this);