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

X11: calling Screen::get_monitors panics #1995

Closed
maan2003 opened this issue Oct 1, 2021 · 0 comments · Fixed by #1996
Closed

X11: calling Screen::get_monitors panics #1995

maan2003 opened this issue Oct 1, 2021 · 0 comments · Fixed by #1996
Labels
shell/x11 concerns the X11 backend

Comments

@maan2003
Copy link
Collaborator

maan2003 commented Oct 1, 2021

use druid::widget::SizedBox;
use druid::{AppLauncher, Screen, WindowDesc};

pub fn main() {
    Screen::get_monitors();
    let main_window = WindowDesc::new(SizedBox::empty());
    AppLauncher::with_window(main_window)
        .log_to_console()
        .launch(())
        .expect("Failed to launch application");
}

error:

'Main thread assertion failed 1 != 0', druid-shell/src/util.rs:39:9

useful parts of backtrace

   2: druid_shell::util::assert_main_thread
             at /src/druid/druid-shell/src/util.rs:39:9
   3: druid_shell::application::Application::try_global
             at /src/druid/druid-shell/src/application.rs:124:9
   4: druid_shell::backend::x11::screen::get_monitors
             at /src/druid/druid-shell/src/backend/x11/screen.rs:38:37
   5: druid_shell::screen::Screen::get_monitors
             at /src/druid/druid-shell/src/screen.rs:87:9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
shell/x11 concerns the X11 backend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant