- commit
- 42c987a04937250b2af411bd2d2208c36da772ce
- parent
- a532c9a43054bf86cbe1f16930f3f75805c5fec8
- author
- dami etoile <dami.etoile@gmail.com>
| M | .github/ | 5 | +++-- |
| M | src-tauri/ | 19 | +++++++++++-------- |
@@ -17,7 +17,7 @@ jobs:
1717 target: aarch64-apple-darwin1818 - platform: macos-131919 target: x86_64-apple-darwin20- - platform: ubuntu-22.0420+ - platform: ubuntu-24.042121 target: x86_64-unknown-linux-gnu2222 - platform: ubuntu-24.04-arm2323 target: aarch64-unknown-linux-gnu@@ -51,7 +51,8 @@ jobs:
5151 libxrandr-dev \5252 libxext-dev \5353 libxinerama-dev \54- libpipewire-0.3-dev54+ libpipewire-0.3-dev \55+ libxdo-dev5556 5657 - uses: tauri-apps/tauri-action@v05758 env:@@ -765,15 +765,18 @@ async fn stream_frames(conn: Connection, app: &AppHandle) -> anyhow::Result<()>
765765 return Ok(());766766 }767767 768- // Detect screen dimensions (one-time xcap call)768+ // Detect screen dimensions (one-time xcap call, in spawn_blocking to keep future Send)769769 let (w, h) = {770- let monitors = xcap::Monitor::all().context("failed to enumerate monitors")?;771- let mon = monitors772- .into_iter()773- .next()774- .ok_or_else(|| anyhow::anyhow!("no monitors found"))?;775- let img = mon.capture_image()?;776- (img.width() as usize, img.height() as usize)770+ tokio::task::spawn_blocking(|| -> anyhow::Result<(usize, usize)> {771+ let monitors = xcap::Monitor::all().context("failed to enumerate monitors")?;772+ let mon = monitors773+ .into_iter()774+ .next()775+ .ok_or_else(|| anyhow::anyhow!("no monitors found"))?;776+ let img = mon.capture_image()?;777+ Ok((img.width() as usize, img.height() as usize))778+ })779+ .await??777780 };778781 eprintln!("[host] screen resolution: {}x{}", w, h);779782