Short info header:
I'd like to give the newly merged GL backend a try, with Ruffle (with a 2-line patch on top of its master, to allow selecting the GL backend).
On startup, I get:
[... INFO gfx_backend_gl::window::egl] Using X11 platform
But then:
[... INFO wgpu_core::instance] Instance::create_surface
thread 'main' panicked at 'Unsupported window: Wayland(WaylandHandle { surface:
I tried forcing gfx to either use only X11 (through XWayland), _or_ only Wayland (natively); but could only do the former, by setting WAYLAND_DISPLAY=''
The same method doesn't work for disabling X11 though (DISPLAY=''), gfx will still try to use X11, but will fail to open the display.
I also tried EGL_PLATFORM=wayland, but that didn't seem to do anything.
I imagine that we could prefer Wayland if we discover it to be available, over X11, and expect all windows to be Wayland handles.
That seems reasonable to me.
Will the WAYLAND_DISPLAY='' forced fallback to X11/XWayland still work then, with the added expectation?
No idea. We need to find out!
Commenting because I worked in this recently. For the GL backend I recently added support for wayland (#3545), before that it only supported X (which is the version you are using).
I think the issue you are hitting is actually because of winit - winit by default will prefer to use wayland directly and gives us a wayland window if possible - which obviously causes problems as gfx had only supported X. I鈥檓 sure you can force winit to use XWayland which should make things work in your case.
I don鈥檛 know if gfx should attempt a fallback here - the issue (which I hit) is that gfx attempts to create a context before we know for use what window manager we will be drawing into. If they don鈥檛 match, then the context has to be recreates
I鈥檓 sure you can force winit to use XWayland which should make things work in your case.
Yes, I could, and I mentioned this in the original report as well.
It's just... How does this work at all for anyone on Wayland (directly) who _also_ has X11 available (via XWayland)? This will be the case for a vast majority of users for many years still, I believe.
Right, the way it currently works on master is it first checks for a wayland session, and if that fails it falls back to X. This previously didn鈥檛 work as the GL backend didn鈥檛 support Wayland.
Ah, I see. Wasn't aware that this was already changed in master, sorry.
Most helpful comment
Right, the way it currently works on master is it first checks for a wayland session, and if that fails it falls back to X. This previously didn鈥檛 work as the GL backend didn鈥檛 support Wayland.