Always mark keydown events as handled to suppress beep

Antonio Scandurra created

Change summary

crates/gpui/src/platform/mac/window.rs | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

Detailed changes

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

@@ -721,19 +721,16 @@ extern "C" fn handle_key_equivalent(this: &Object, _: Sel, native_event: id) ->
             let _: BOOL = msg_send![input_context, handleEvent: native_event];
         }
 
-        let mut handled = false;
         let mut window_state_borrow = window_state.borrow_mut();
         if let Some(event) = window_state_borrow.pending_key_down_event.take() {
             if let Some(mut callback) = window_state_borrow.event_callback.take() {
                 drop(window_state_borrow);
-                handled = callback(Event::KeyDown(event));
+                callback(Event::KeyDown(event));
                 window_state.borrow_mut().event_callback = Some(callback);
             }
-        } else {
-            handled = true;
         }
 
-        handled as BOOL
+        YES
     } else {
         NO
     }