Closed zrz4066 closed 9 months ago
Thanks for the bug report.
This seems to be a bug in winit. Winit should ideally report the error instead of panicking. It shouldn't unwrap there, but return an error instead: https://github.com/rust-windowing/winit/blob/cc33212479b5c9e75ff6ceb16f7a817ddf9950f2/src/platform_impl/linux/mod.rs#L794
The cause seems to be that it cannot open the X11 display, so maybe the DISPLAY env is not set correctly or some other config problem.
If only winit was reporting the good error, we could display it properly in vscode instead of having a panic like this.
What we should do is fix the bug upstream, or at least report it there. And then make sure that the lsp report the error to vscode properly when this happens.
It's also a little odd that we end up at the X11 stage. WSL supports wayland, so that should have been tried first and that should work (we spent some time fixing that, with softbuffer fallback, etc.). @zrz4066 if you open a wsl bash shell, do you have the WAYLAND_DISPLAY
environment variable set?
The winit bug has been fixed with https://github.com/rust-windowing/winit/pull/3355 But now i'd need to test what happens when winit report an error. That is a duplicated of https://github.com/slint-ui/slint/issues/204
Vs code open slint project in ubuntu on WLS2 WSL2 Ubuntu22.04 ,slint preiew crash
thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/platform_impl/linux/mod.rs:787:62: called
Result::unwrap()
on anErr
value: XOpenDisplayFailed note: run withRUST_BACKTRACE=1
environment variable to display a backtrace [Info - 9:56:19 AM] Connection to server got closed. Server will restart. true The Slint Language Server crashed. This is a bug. Please open an issue on https://github.com/slint-ui/slint/issues thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/platform_impl/linux/mod.rs:787:62: calledResult::unwrap()
on anErr
value: XOpenDisplayFailed note: run withRUST_BACKTRACE=1
environment variable to display a backtrace [Info - 9:56:38 AM] Connection to server got closed. Server will restart. true The Slint Language Server crashed. This is a bug. Please open an issue on https://github.com/slint-ui/slint/issues thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/platform_impl/linux/mod.rs:787:62: calledResult::unwrap()
on anErr
value: XOpenDisplayFailed note: run withRUST_BACKTRACE=1
environment variable to display a backtrace [Info - 9:57:09 AM] Connection to server got closed. Server will restart. true The Slint Language Server crashed. This is a bug. Please open an issue on https://github.com/slint-ui/slint/issues