egui: Can not run official example with error NoAvailablePixelFormat...

Describe the bug

As my title say…

To Reproduce Steps to reproduce the behavior:

  1. Clone the repo to local
  2. Into the repo dir and run command cargo run -p hello_world

Expected behavior Run and show a gui.

Screenshots image

Desktop (please complete the following information):

  • OS: Ubuntu 22.04 with Gnome and Wayland.
  • Browser Both Firefox and Chrome.
  • Version Default version…

Additional context

No.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 22 (14 by maintainers)

Most upvoted comments

I also stumbled over this glutin bug in Slint and confirm that it is fixed in the master branch of glutin. 🎉

Since currently nvidia drivers have various issues on wayland. since both glfw and sdl2 using x11 by default, telling winit to use x11 might help:

fn main() {
    #[cfg(all(unix, not(target_os = "macos")))]
    std::env::set_var("WINIT_UNIX_BACKEND", "x11");
    let options = eframe::NativeOptions::default();
    eframe::run_native(
        "Using x11",
        options,
        Box::new(|_cc| Box::new(MyApp::default())),
    );
}

yeah, I can confirm that if i set double buffer to false and vsync to false. i get a window.

the main issue seems to be that when glutin tries to get the MAX_SWAP_INTERVAL with GetConfigAttrib function, it returns zero in all configurations 😦 . so, you are forced to set vsync to off.

so, we just wait for https://github.com/rust-windowing/glutin/issues/1444 in a new release i guess. EDIT: it seems glutin already has a beta release 0.30 on crates.io. but we cannot use it yet as wgpu is still using raw-window-handle 0.4. wgpu will make a release on september 28

for me, it seems the issue lies with winit/glutin:

winit,wgpu => works, but wgpu surface doesn’t have a srgb supporting format 😦 winit,glow (glutin) => fail with the pixel format error

glfw or sdl2 with glow or wgpu => works normally including srgb framebuffer support.