Don't assume BOOL is a boolean

This commit is contained in:
Antonio Scandurra 2022-09-16 11:02:55 +02:00
parent 80d7df7664
commit 582ca666d0
3 changed files with 4 additions and 4 deletions

View file

@ -144,7 +144,7 @@ impl StatusItem {
Weak::into_raw(Rc::downgrade(&state)) as *const c_void, Weak::into_raw(Rc::downgrade(&state)) as *const c_void,
); );
native_view.setWantsBestResolutionOpenGLSurface_(YES); native_view.setWantsBestResolutionOpenGLSurface_(YES);
native_view.setWantsLayer(true); native_view.setWantsLayer(YES);
let _: () = msg_send![ let _: () = msg_send![
native_view, native_view,
setLayerContentsRedrawPolicy: NSViewLayerContentsRedrawDuringViewResize setLayerContentsRedrawPolicy: NSViewLayerContentsRedrawDuringViewResize

View file

@ -450,7 +450,7 @@ impl Window {
native_window.setTitle_(NSString::alloc(nil).init_str(title)); 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 if options
.titlebar .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) { extern "C" fn window_did_change_key_status(this: &Object, selector: Sel, _: id) {
let window_state = unsafe { get_window_state(this) }; let window_state = unsafe { get_window_state(this) };
let window_state_borrow = window_state.borrow(); 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 // 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 // `windowDidBecomeKey` message to the previous key window even though that window

View file

@ -10,7 +10,7 @@ class LKRoomDelegate: RoomDelegate {
self.data = data self.data = data
self.onDidSubscribeToRemoteVideoTrack = onDidSubscribeToRemoteVideoTrack self.onDidSubscribeToRemoteVideoTrack = onDidSubscribeToRemoteVideoTrack
} }
func room(_ room: Room, participant: RemoteParticipant, didSubscribe publication: RemoteTrackPublication, track: Track) { func room(_ room: Room, participant: RemoteParticipant, didSubscribe publication: RemoteTrackPublication, track: Track) {
if track.kind == .video { if track.kind == .video {
self.onDidSubscribeToRemoteVideoTrack(self.data, Unmanaged.passRetained(track).toOpaque()) self.onDidSubscribeToRemoteVideoTrack(self.data, Unmanaged.passRetained(track).toOpaque())