Skip to content

Commit

Permalink
Compare explicitly to YES/NO instead relying on booliness for objc (#…
Browse files Browse the repository at this point in the history
…20567)

Just x86_64-apple-darwin things. Fixes the build for nightly.

Release Notes:

- N/A
  • Loading branch information
rgbkrk authored Nov 13, 2024
1 parent 5473519 commit 0547748
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/gpui/src/platform/mac/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand All @@ -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;
}

Expand All @@ -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;
}
}
Expand Down

0 comments on commit 0547748

Please sign in to comment.