Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #30 from AugmendTech/liam/fix_intel_macos
Browse files Browse the repository at this point in the history
Fix intel macos compilation problem caused by objc2 Bool::from_raw (v0.3.5)
  • Loading branch information
OutOfTheVoid authored May 23, 2024
2 parents 61f7925 + 947531b commit 7f0be10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "crabgrab"
description = "A cross-platform screen/window capture crate"
version = "0.3.4"
version = "0.3.5"
edition = "2021"
authors = ["Augmend, Inc. <https://github.com/AugmendTech>", "Liam Taylor <https://github.com/OutOfTheVoid>", "Tim Misiak <https://github.com/TimMisiak>"]
documentation = "https://docs.rs/crabgrab"
Expand Down
10 changes: 5 additions & 5 deletions src/platform/macos/objc_wrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,8 +713,8 @@ impl SCShareableContent {
unsafe {
let _: () = msg_send![
class!(SCShareableContent),
getShareableContentExcludingDesktopWindows: Bool::from_raw(excluding_desktop_windows)
onScreenWindowsOnly: Bool::from_raw(onscreen_windows_only)
getShareableContentExcludingDesktopWindows: Bool::new(excluding_desktop_windows)
onScreenWindowsOnly: Bool::new(onscreen_windows_only)
completionHandler: &*handler_block
];
}
Expand Down Expand Up @@ -932,14 +932,14 @@ impl SCStreamConfiguration {
pub(crate) fn set_show_cursor(&mut self, show_cursor: bool) {
unsafe {
let show_cursor_ivar = class!(SCStreamConfiguration).instance_variable("_showsCursor").expect("_showsCursor ivar on SCStreamConfiguration");
*show_cursor_ivar.load_mut(&mut *self.0) = Bool::from_raw(show_cursor);
*show_cursor_ivar.load_mut(&mut *self.0) = Bool::new(show_cursor);
}
}

pub(crate) fn set_capture_audio(&mut self, capture_audio: bool) {
unsafe {
let captures_audio_ivar = class!(SCStreamConfiguration).instance_variable("_capturesAudio").expect("_capturesAudio ivar on SCStreamConfiguration");
*captures_audio_ivar.load_mut(&mut *self.0) = Bool::from_raw(capture_audio);
*captures_audio_ivar.load_mut(&mut *self.0) = Bool::new(capture_audio);
}
}

Expand All @@ -953,7 +953,7 @@ impl SCStreamConfiguration {
pub(crate) fn set_exclude_current_process_audio(&mut self, exclude_current_process_audio: bool) {
unsafe {
let exclude_current_process_audio_ivar = class!(SCStreamConfiguration).instance_variable("_excludesCurrentProcessAudio").expect("_excludesCurrentProcessAudio ivar on SCStreamConfiguration");
*exclude_current_process_audio_ivar.load_mut(&mut *self.0) = Bool::from_raw(exclude_current_process_audio);
*exclude_current_process_audio_ivar.load_mut(&mut *self.0) = Bool::new(exclude_current_process_audio);
}
}
}
Expand Down

0 comments on commit 7f0be10

Please sign in to comment.