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

Commit

Permalink
update macos docs
Browse files Browse the repository at this point in the history
  • Loading branch information
liam committed Apr 19, 2024
1 parent 8ca2324 commit c007373
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,16 @@
<a href="#158" id="158">158</a>
<a href="#159" id="159">159</a>
<a href="#160" id="160">160</a>
<a href="#161" id="161">161</a>
<a href="#162" id="162">162</a>
</pre></div><pre class="rust"><code><span class="kw">use </span>std::{cell::Cell, fmt::Debug, hash::Hash};

<span class="kw">use </span>futures::channel::oneshot;
<span class="kw">use </span>libc::getpid;

<span class="kw">use crate</span>::{capturable_content::{CapturableContentFilter, CapturableContentError}, util::{Rect, Point, Size}};

<span class="kw">use </span><span class="kw">super</span>::objc_wrap::{SCDisplay, SCRunningApplication, SCShareableContent, SCWindow};
<span class="kw">use </span><span class="kw">super</span>::objc_wrap::{CGMainDisplayID, SCDisplay, SCRunningApplication, SCShareableContent, SCWindow};

<span class="kw">pub struct </span>MacosCapturableContent {
<span class="kw">pub </span>windows: Vec&lt;SCWindow&gt;,
Expand All @@ -174,6 +176,8 @@

<span class="kw">impl </span>MacosCapturableContent {
<span class="kw">pub async fn </span>new(filter: CapturableContentFilter) -&gt; <span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>, CapturableContentError&gt; {
<span class="comment">// Force core graphics initialization
</span><span class="kw">unsafe </span>{ CGMainDisplayID() };
<span class="kw">let </span>(exclude_desktop, onscreen_only) = filter.windows.map_or((<span class="bool-val">false</span>, <span class="bool-val">true</span>), |filter| (!filter.desktop_windows, filter.onscreen_only));
<span class="kw">let </span>(tx, rx) = oneshot::channel();
<span class="kw">let </span>tx = Cell::new(<span class="prelude-val">Some</span>(tx));
Expand Down

0 comments on commit c007373

Please sign in to comment.