Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic when calling Monitor::all() while plugging in external display on macOS #118

Closed
tpatterson opened this issue Mar 29, 2024 · 2 comments

Comments

@tpatterson
Copy link

tpatterson commented Mar 29, 2024

To duplicate the problem: Start this test, then once it is going plug in an external monitor. You might have to try it several times before the error happens.


    #[test]
    fn test_xcap_monitor_all() {
        for _ in 0..1000 {
            match Monitor::all() {
                Ok(_) => (),
                Err(e) => core::panic!("Error occurred: {:?}", e),
            }
            // Sleep for a short duration to not overwhelm the system
            sleep(Duration::from_millis(100));
        }
    }

Here is the error:


Error occurred: Error("Get display mode failed")
thread 'interface::screen_detector::tests::test_xcap_monitor_all' panicked at src/interface/screen_detector.rs:390:27:
Error occurred: Error("Get display mode failed")
stack backtrace:
   0: rust_begin_unwind
             at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/panicking.rs:647:5
   1: core::panicking::panic_fmt
             at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/panicking.rs:72:14
   2: ea_client_lib::interface::screen_detector::tests::test_xcap_monitor_all
             at ./src/interface/screen_detector.rs:390:27
   3: ea_client_lib::interface::screen_detector::tests::test_xcap_monitor_all::{{closure}}
             at ./src/interface/screen_detector.rs:386:31
   4: core::ops::function::FnOnce::call_once
             at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/ops/function.rs:250:5
   5: core::ops::function::FnOnce::call_once
             at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@nashaofu
Copy link
Owner

This problem should have been resolved #119

@tpatterson
Copy link
Author

Looks great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants