take 2 on scroll perf for macos 26

Smit Barmase created

Change summary

crates/gpui/src/platform.rs              |  3 +++
crates/gpui/src/platform/mac/platform.rs | 13 +++++++++++++
2 files changed, 16 insertions(+)

Detailed changes

crates/gpui/src/platform.rs 🔗

@@ -957,6 +957,9 @@ impl PlatformInputHandler {
     }
 
     pub fn selected_bounds(&mut self, window: &mut Window, cx: &mut App) -> Option<Bounds<Pixels>> {
+        if self.handler.marked_text_range(window, cx).is_none() {
+            return None;
+        }
         let selection = self.handler.selected_text_range(true, window, cx)?;
         self.handler.bounds_for_range(
             if selection.reversed {

crates/gpui/src/platform/mac/platform.rs 🔗

@@ -1370,6 +1370,19 @@ extern "C" fn did_finish_launching(this: &mut Object, _: Sel, _: id) {
             object: nil
         ];
 
+        let defaults: id = msg_send![class!(NSUserDefaults), standardUserDefaults];
+        let keys: [id; 6] = [
+            ns_string("NSAutomaticTextCompletionEnabled"),
+            ns_string("NSAutomaticSpellingCorrectionEnabled"),
+            ns_string("NSAutomaticQuoteSubstitutionEnabled"),
+            ns_string("NSAutomaticDashSubstitutionEnabled"),
+            ns_string("NSAutomaticPeriodSubstitutionEnabled"),
+            ns_string("NSAutomaticCapitalizationEnabled"),
+        ];
+        for key in keys {
+            let _: () = msg_send![defaults, setBool: NO forKey: key];
+        }
+
         let platform = get_mac_platform(this);
         let callback = platform.0.lock().finish_launching.take();
         if let Some(callback) = callback {