From 0547748c4872c7ad4c67bd48ca64417758b3847e Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Tue, 12 Nov 2024 18:35:58 -0800 Subject: [PATCH] Compare explicitly to YES/NO instead relying on booliness for objc (#20567) Just x86_64-apple-darwin things. Fixes the build for nightly. Release Notes: - N/A --- crates/gpui/src/platform/mac/window.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/gpui/src/platform/mac/window.rs b/crates/gpui/src/platform/mac/window.rs index e4ee30553875b..e9c3f0a6bd0b3 100644 --- a/crates/gpui/src/platform/mac/window.rs +++ b/crates/gpui/src/platform/mac/window.rs @@ -1257,13 +1257,13 @@ extern "C" fn handle_key_event(this: &Object, native_event: id, key_equivalent: msg_send![input_context, handleEvent: native_event] }; window_state.as_ref().lock().keystroke_for_do_command.take(); - if handled { + if handled == YES { return YES; } let mut callback = window_state.as_ref().lock().event_callback.take(); let handled: BOOL = if let Some(callback) = callback.as_mut() { - !callback(PlatformInput::KeyDown(event)).propagate + !callback(PlatformInput::KeyDown(event)).propagate as BOOL } else { NO }; @@ -1273,12 +1273,12 @@ extern "C" fn handle_key_event(this: &Object, native_event: id, key_equivalent: let mut callback = window_state.as_ref().lock().event_callback.take(); let handled = if let Some(callback) = callback.as_mut() { - !callback(PlatformInput::KeyDown(event.clone())).propagate + !callback(PlatformInput::KeyDown(event.clone())).propagate as BOOL } else { - false + NO }; window_state.as_ref().lock().event_callback = callback; - if handled { + if handled == YES { return YES; } @@ -1293,7 +1293,7 @@ extern "C" fn handle_key_event(this: &Object, native_event: id, key_equivalent: } NO }); - if handled == Some(true) { + if handled == Some(YES) { return YES; } }