-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bevy wayland window name is "Unknown" #3301
Comments
This seems like a |
Looks like |
I'd be very surprised if we decided it was our job to fix winit not handling a platform properly, although I might be missing some context here. I'd certainly be inclined to push back against any PR which added a fix which linked into platform specific code in this codebase. Winit supports setting the window title - https://docs.rs/winit/0.26.0/winit/window/struct.Window.html#method.set_title, and doesn't list wayland as unsupported there. I had a quick look at winit's issue tracker, and it doesn't seem like this is tracked, although @heavyrain266 it seems like you have more knowledge of how wayland works to report it. |
This is almost certainly because Wayland requires CSDs (client side decorations). Winit literally chooses how / where to draw the window decorations, and probably doesn't have code written (or enabled) to render a title. |
One solution is to depend on a library that can render the decorations (like GTK3) but I appreciate that winit doesn't depend on that. Maybe ultimately we should just draw our own 😄 |
Wayland requires the client to support CSD. There is an extension for server side decorations implemented by (pretty much) everyone except gnome as they really want client side decorations only for some reason despite people complaining. |
For Wayland there is protocol for creating surfaces (there is native rust implementation), it's called xdg-shell which Compositors as renderers connected to headless Display Servers are using for compositing surfaces (images) into window. There is also second protocol called fullscreen-shell which handle fullscreen surfaces. EDIT: Linked protocols and added info about handling fullscreen. |
GNOME is most problematic Wayland DE to support, they don't follow any existing standards used by almost every software/server author, many programs which are adding HUDs and Overlays for Wayland doesn't work in GNOME because they don't want to support popular Layershell protocol which adds z-index to renderer as "layers" where author choose layer to render his software i.e on top of everything or most bottom layer for wallpaper image/gif/shader. |
Investigation
Conclusion and one Possible solutionBevy disabled |
… (#8722) # Objective - Fix Wayland window client side decorations issue on Gnome Wayland, fixes #3301. ## Solution - One simple one line solution: Add winit's `wayland-csd-adwaita` feature to Bevy's `wayland` feature. Copied from bevyengine/bevy#3301 (comment): ### Investigation 1. Gnome forced Wayland apps to implement CSD, whether on their own or using some libraries like Gnome's official solution [libdecor](https://gitlab.freedesktop.org/libdecor/libdecor). Many Linux apps do this with libdecor, like blender, kitty... I think it's not comfortable for Bevy to fix this problem this way. 2. Winit has support for CSD on wayland(https://github.com/rust-windowing/winit/blob/8bb004a1d9ec1b40cbb9831a6dea774d4b6d6d7b/Cargo.toml#L42), but Bevy disabled Winit's default features, thus no winit's `wayland-csd-adwaita` feature. And Bevy's `wayland` feature doesn't include winit's `wayland-csd-adwaita` feature so users can't get window decorations on Wayland even with Bevy's `wayland` feature enabled. 3. Many rust UI toolkit, like iced, doesn't disable winit's `wayland-csd-adwaita` feature. ### Conclusion and one Possible solution Bevy disabled `winit`'s default features in order to decrease package size. But I think it's acceptable to add `winit`'s `wayland-csd-adwaita` feature to Bevy's `wayland` feature gate to fix this issue easily for this only add on crate: sctk-adwaita.
Bevy version
Current main branch
25b62f9
Operating system & version
Fedora 35
What you did
cargo run --example 3d_scene --features bevy/wayland
What you expected to happen
Name should be the same as executable. It's correct with feature

bevy/x11
What actually happened
Application name is "Unknown". Apart from that, title bar is not native and doesn't change after "Set title" is called.

Additional information
I updated the code of
3d_scene
example to change the title. It's correct inx11
, but not inwayland
:Suggestion
Do we need to include more examples with
set_title
? I found only 1 usage inwindow_settings
example.The text was updated successfully, but these errors were encountered: