rust-windowing / winit

Window handling library in pure Rust
https://docs.rs/winit/
Apache License 2.0
4.89k stars 914 forks source link

EventLoop::new() has NotSupported Err value #3883

Closed RedPlayer1 closed 3 months ago

RedPlayer1 commented 3 months ago

Description

When attempting to run a simple program with only

let event_loop = EventLoop::new().unwrap();

in the main function, it panics at runtime with

thread 'main' panicked at src/main.rs:5:39:
called `Result::unwrap()` on an `Err` value: NotSupported(NotSupportedError)

My current theory is that I am missing at least one X11 library but I cannot find a list of required ones.

OS and window mananger

OS: Void Linux 6.6.46_1 x86_64 (musl) Window Manager: dwm 6.4 (patched)

Winit version

0.30.5

notgull commented 3 months ago

Make sure the following libraries are installed on your machine:

apt install libx11-xcb-dev xinput libxcursor-dev libxkbcommon-x11-dev libx11-dev

Not sure what the equivalents are in Void.

notgull commented 3 months ago

@kchibisov Given the prevalence of these bug reports it may be worth reconsidering your position here.

RedPlayer1 commented 3 months ago

I have the following packages installed but it still doesn't work:

kchibisov commented 3 months ago

@notgull I think the main issue is that all the error information is getting discarded by the new_x11_any_thread function and has nothing to do with what I said on the review. Probably, it stop doing so, you'll have everything in place, but you still don't need to touch anything in src/error.rs with that approach, since Wayland somehow manages to embed all the information needed.

madsmtm commented 3 months ago

Was it intentional to close this? Seems to me like the underlying issue has not been diagnosed, we've only made logging better so that it may be diagnosed in the future

kchibisov commented 3 months ago

It's a setup issue, if it's not it could always be reopened, but it's unlikely anything else.

The main issue was that it wasn't clear what exactly we lack in this particular case, but now it's all properly logged.