Closed genodeftest closed 5 years ago
Basic glutin usage on wayland should work, unfortunately servo is not doing something like "basic" usage (see https://github.com/servo/servo/issues/9558 ).
You can try unsetting the WAYLAND_DISPLAY
from your environment, this should prevent glutin from finding the wayland compositor, and making it fallback to X11.
hm, with unset WAYLAND_DISPLAY
, servo runs into an unimplemented!()
in glutin::api::wayland::window::{{impl}}::platform_display
, so the same as you referenced in servo/servo#9958.
./mach run --dev
not yet implemented (thread main, at /home/username/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/servo-glutin-0.6.1/src/api/wayland/window.rs:324)
not yet implemented (thread PaintThread PipelineId { namespace_id: PipelineNamespaceId(0), index: PipelineIndex(0) }, at /home/username/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/servo-glutin-0.6.1/src/api/wayland/window.rs:26)
not yet implemented (thread Constellation, at /home/username/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/servo-glutin-0.6.1/src/api/wayland/window.rs:26)
stack backtrace:
0: 0x561f533357f1 - backtrace::backtrace::libunwind::trace
at /home/username/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.2.3/src/backtrace/mod.rs:82
- backtrace::backtrace::trace<closure>
at /home/username/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.2.3/src/backtrace/mod.rs:70
1: 0x561f53336380 - backtrace::capture::{{impl}}::new
at /home/username/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.2.3/src/lib.rs:96
2: 0x561f4f0ccf1b - servo::main::{{closure}}
at /path/to/repository/of/servo/components/servo/main.rs:121
3: 0x561f53d50a55 - std::panicking::rust_panic_with_hook::hb1322e5f2588b4db
4: 0x561f4f0d7823 - std::panicking::begin_panic<&str>
at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:383
5: 0x561f4f10b14d - glutin::api::wayland::window::{{impl}}::platform_display
at /path/to/repository/of/servo/components/servo/<std macros>:3
6: 0x561f4f10cbf1 - glutin::platform::platform::api_dispatch::{{impl}}::platform_display
at /home/username/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/servo-glutin-0.6.1/src/platform/linux/api_dispatch.rs:336
7: 0x561f4f10b4fc - glutin::window::{{impl}}::platform_display
at /home/username/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/servo-glutin-0.6.1/src/window.rs:441
8: 0x561f4f11965f - glutin_app::window::{{impl}}::native_display
at /path/to/repository/of/servo/ports/glutin/window.rs:834
9: 0x561f4f0675f8 - compositing::compositor::{{impl}}::new<glutin_app::window::Window>
at /path/to/repository/of/servo/components/compositing/compositor.rs:460
10: 0x561f4f06a5e9 - compositing::compositor::{{impl}}::create<glutin_app::window::Window>
at /path/to/repository/of/servo/components/compositing/compositor.rs:506
11: 0x561f4efb79e7 - servo::{{impl}}::new<glutin_app::window::Window>
at /path/to/repository/of/servo/components/servo/lib.rs:192
12: 0x561f4f0c2175 - servo::main
at /path/to/repository/of/servo/components/servo/main.rs:143
13: 0x561f53d58cc6 - __rust_maybe_catch_panic
14: 0x561f53d4fb61 - std::rt::lang_start::haaae1186de9de8cb
15: 0x561f4f0cd273 - main
16: 0x7f4fa2438730 - __libc_start_main
17: 0x561f4ef7bf78 - _start
18: 0x0 - <unknown>
Servo exited with return value 101
This is troubling... What version of libwayland to you have? What wayland compositor do you use, and what is the value of WAYLAND_DISPLAY
on your system?
What version of libwayland to you have?
libwayland-client-1.10.0-1.fc24.x86_64
What wayland compositor do you use
Gnome-shell 3.20
what is the value of WAYLAND_DISPLAY on your system?
WAYLAND_DISPLAY=wayland-0
by default. Not existing when I unset it.
I'll try in another wayland session and report back.
Even in a pure Weston session servo tries to use the wayland glutin API with unset WAYLAND_DISPLAY
. So one of them (servo, glutin) has a different way to detect wayland or doesn't respect unsetting the environment variable.
Oh, my bad, I thought libwayland had removed the default fallback on wayland-0
, but they actually reverted it
So unsetting the environment variable won't prevent wayland to be used... So, to prevent glutin to use wayland, you'll need to patch it here : https://github.com/tomaka/glutin/blob/master/src/platform/linux/api_dispatch.rs#L37 replacing this line by if false
for example.
Annnnd actually writing this, I realize the dispatch logic is broken, as it makes glutin use wayland as long as the wayland lib is here, even if no compositor is running, and I don't understand how it could have worked on my system when I pushed that code... I'll need to correct that.
The ideal would be to add an env variable allowing to force X11 for glutin... @tomaka are you still opposed to this? Something like GLUTIN_BACKEND
, which can be set to wayland
or x11
and if set to any of them glutin only tries this backend, rather than a fallback mechanism.
Now, outside of this hot-fix, what really bugs me is that the error is not the same depending on whether the WAYLAND_DISPLAY
is set or not, while the only logic checking this env variable is in libwayland-client.so
and it fallbacks to wayland-0
if the variable is not set, so both cases should be identical...
@vberger this issue is no longer relevant, correct?
When running servo under wayland, I'm getting this error message:
eglCreateContext failed: 0x3009 (thread main, at /home/username/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/servo-glutin-0.6.1/src/api/egl/mod.rs:726
From #577 I guess glutin doesn't support wayland yet. Any chance to force-fallback to X11?