From 582ca666d013b5bf80f8dc12cf30c1f926c44a9e Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 16 Sep 2022 11:02:55 +0200 Subject: [PATCH] Don't assume `BOOL` is a boolean --- crates/gpui/src/platform/mac/status_item.rs | 2 +- crates/gpui/src/platform/mac/window.rs | 4 ++-- .../LiveKitBridge/Sources/LiveKitBridge/LiveKitBridge.swift | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/gpui/src/platform/mac/status_item.rs b/crates/gpui/src/platform/mac/status_item.rs index 404b5e2ef4..33feb4808f 100644 --- a/crates/gpui/src/platform/mac/status_item.rs +++ b/crates/gpui/src/platform/mac/status_item.rs @@ -144,7 +144,7 @@ impl StatusItem { Weak::into_raw(Rc::downgrade(&state)) as *const c_void, ); native_view.setWantsBestResolutionOpenGLSurface_(YES); - native_view.setWantsLayer(true); + native_view.setWantsLayer(YES); let _: () = msg_send![ native_view, setLayerContentsRedrawPolicy: NSViewLayerContentsRedrawDuringViewResize diff --git a/crates/gpui/src/platform/mac/window.rs b/crates/gpui/src/platform/mac/window.rs index 375a271eac..be51b67560 100644 --- a/crates/gpui/src/platform/mac/window.rs +++ b/crates/gpui/src/platform/mac/window.rs @@ -450,7 +450,7 @@ impl Window { native_window.setTitle_(NSString::alloc(nil).init_str(title)); } - native_window.setMovable_(options.is_movable); + native_window.setMovable_(options.is_movable as BOOL); if options .titlebar @@ -1077,7 +1077,7 @@ fn window_fullscreen_changed(this: &Object, is_fullscreen: bool) { extern "C" fn window_did_change_key_status(this: &Object, selector: Sel, _: id) { let window_state = unsafe { get_window_state(this) }; let window_state_borrow = window_state.borrow(); - let is_active = unsafe { window_state_borrow.native_window.isKeyWindow() }; + let is_active = unsafe { window_state_borrow.native_window.isKeyWindow() as bool }; // When opening a pop-up while the application isn't active, Cocoa sends a spurious // `windowDidBecomeKey` message to the previous key window even though that window diff --git a/crates/live_kit/LiveKitBridge/Sources/LiveKitBridge/LiveKitBridge.swift b/crates/live_kit/LiveKitBridge/Sources/LiveKitBridge/LiveKitBridge.swift index fb1eb9a79e..f59b829203 100644 --- a/crates/live_kit/LiveKitBridge/Sources/LiveKitBridge/LiveKitBridge.swift +++ b/crates/live_kit/LiveKitBridge/Sources/LiveKitBridge/LiveKitBridge.swift @@ -10,7 +10,7 @@ class LKRoomDelegate: RoomDelegate { self.data = data self.onDidSubscribeToRemoteVideoTrack = onDidSubscribeToRemoteVideoTrack } - + func room(_ room: Room, participant: RemoteParticipant, didSubscribe publication: RemoteTrackPublication, track: Track) { if track.kind == .video { self.onDidSubscribeToRemoteVideoTrack(self.data, Unmanaged.passRetained(track).toOpaque())