Closed zrz4066 closed 1 year ago
You're running Xfwm4 under WSL. As far as I can tell, Xfwm4 only acts as X11 window manager (and compositor), but not as wayland compositor. That means Slint will try to connect via GLX, which also doesn't work (I suppose that part is WSL related).
At the moment WSL only works with software rendering or Wayland, but not GLX.
However, Slint should fall back to software rendering if the GLX setup fails. That seems like a bug to me.
Meanwhile, does it work if you set the SLINT_BACKEND
environment variable to the value winit-software
?
the renderer-winit-software feature wasn't enabled by default in the last release (1.1.1). But it will be in the next release (1.2).
Thanks, that explains it. @zrz4066 then your workaround is to edit Cargo.toml
and change the line that says
slint = "1.0"
to read
slint = { version = "1.0", features = ["renderer-winit-software"] }
and this will not be needed anymore in the next release.
Created by cargo generate --git https://github.com/slint-ui/slint-rust-template --name myguitest
it can't work well after cargo run, the following are the error message ice@DESKTOP-OH5PBNG:~/rust/myguitest$ cargo run Finished dev [unoptimized + debuginfo] target(s) in 0.21s Running
target/debug/myguitest
Error: Other("Winit backend failed to find a suitable renderer. Last failure was: Cannot create OpenGL context: [a1] GLXBadFBConfig")ice@DESKTOP-OH5PBNG:~/rust/myguitest$ neofetch .-/+oossssoo+/-. ice@DESKTOP-OH5PBNG
:+ssssssssssssssssss+:
------------------- -+ssssssssssssssssssyyssss+- OS: Ubuntu 20.04.6 LTS on Windows 10 x86_64 .ossssssssssssssssssdMMMNysssso. Kernel: 5.10.16.3-microsoft-standard-WSL2 /ssssssssssshdmmNNmmyNMMMMhssssss/ Uptime: 15 mins +ssssssssshmydMMMMMMMNddddyssssssss+ Packages: 1254 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/ Shell: bash 5.0.17 .ssssssssdMMMNhsssssssssshNMMMdssssssss. Resolution: 1904x1001 +sssshhhyNMMNyssssssssssssyNMMMysssssss+ WM: Xfwm4 ossyNMMMNyMMhsssssssssssssshmmmhssssssso WM Theme: Default ossyNMMMNyMMhsssssssssssssshmmmhssssssso Theme: Adwaita [GTK3] +sssshhhyNMMNyssssssssssssyNMMMysssssss+ Icons: Adwaita [GTK3] .ssssssssdMMMNhsssssssssshNMMMdssssssss. Terminal: /dev/pts/1 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/ CPU: Intel i5-8265U (8) @ 1.800GHz +sssssssssdmydMMMMMMMMddddyssssssss+ GPU: Microsoft Corporation Device 008e /ssssssssssshdmNNNNmyNMMMMhssssss/ Memory: 242MiB / 12542MiB .ossssssssssssssssssdMMMNysssso. -+sssssssssssssssssyyyssss+-:+ssssssssssssssssss+:
.-/+oossssoo+/-.