nashaofu / xcap

XCap is a cross-platform screen capture library written in Rust. It supports Linux (X11, Wayland), MacOS, and Windows. XCap supports screenshot and video recording (to be implemented).
https://docs.rs/xcap
Apache License 2.0
459 stars 55 forks source link

Panic in Window::all() while in mission control on MacOS #116

Closed tpatterson closed 5 months ago

tpatterson commented 5 months ago

This panic happens consistently when trying to call Window::all() while the screen is in mission control (4-finger swipe up)

thread 'main' panicked at /Users/rex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/core-foundation-0.9.4/src/string.rs:28:1:
Attempted to create a NULL object.
stack backtrace:
   0: std::panicking::begin_panic
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/panicking.rs:688:12
   1: <core_foundation::string::CFString as core_foundation::base::TCFType>::wrap_under_create_rule
             at /Users/rex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/core-foundation-0.9.4/src/lib.rs:110:17
   2: <T as core_foundation::base::FromVoid>::from_void
             at /Users/rex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/core-foundation-0.9.4/src/base.rs:358:31
   3: xcap::platform::impl_window::ImplWindow::new
             at /Users/rex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/xcap-0.0.6/src/macos/impl_window.rs:89:17
   4: xcap::platform::impl_window::ImplWindow::all
             at /Users/rex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/xcap-0.0.6/src/macos/impl_window.rs:179:35
   5: xcap::window::Window::all
image
nashaofu commented 5 months ago

fixed in #117

tpatterson commented 5 months ago

Fixed! Brilliant! and thank you very much. As promised I sponsored you again for this and those other things you fixed while you were at it.

nashaofu commented 5 months ago

Thank you again