-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Expose .with_class()
in WindowDescriptor
after new winit release to allow setting window class on X11 and app_id on Wayland.
#4188
Comments
relevant winit api: https://docs.rs/winit/latest/winit/window/struct.WindowBuilder.html#method.with_app_id. This should be feature gated on wayland |
Why should it be feature gated on wayland? It would be much easier to allow it on all platforms and just pass it to winit on unix. In addition while winit currently only uses it on wayland, other OSes do have a similar concept. For example macOS has the bundle id. And gtk has an application id that is used for wayland and for remote control using dbus. In addition things like the |
Maybe, but the method is written as working only on wayland. Otherwise we should expose the |
I don't really know how other systems handle that kind of feature, I'm not really interested in GTK because it does everything in weird way just like GNOME itself, X11 doesn't even have any documentation other than XML file with general implementation, as well as Xorg's 400k lines of code. |
Future winit release will include unified |
.with_app_id()
from winit in WindowDescriptor
for better Wayland integration on Linux target..with_class()
in WindowDescriptor
after new winit release to allow setting window class on X11 and app_id on Wayland.
New winit will have unified call |
# Objective - Fixes #4188, make users could set application ID for bevy apps. ## Solution - Add `name` field to `bevy::window::Window`. Specifying this field adds different properties to the window: application ID on `Wayland`, `WM_CLASS` on `X11`, or window class name on Windows. It has no effect on other platforms. --- ## Changelog ### Added - Add `name` to `bevy::window::Window`. ## Migration Guide - Set the `bevy_window::Window`'s `name` field when needed: ```rust App::new() .add_plugins(DefaultPlugins.set(WindowPlugin { primary_window: Some(Window { title: "I am a window!".into(), name: Some("SpaceGameCompany.SpaceShooter".into()), ..default() }), ..default() })) .run(); ``` --------- Co-authored-by: François <[email protected]>
# Objective - Fixes bevyengine#4188, make users could set application ID for bevy apps. ## Solution - Add `name` field to `bevy::window::Window`. Specifying this field adds different properties to the window: application ID on `Wayland`, `WM_CLASS` on `X11`, or window class name on Windows. It has no effect on other platforms. --- ## Changelog ### Added - Add `name` to `bevy::window::Window`. ## Migration Guide - Set the `bevy_window::Window`'s `name` field when needed: ```rust App::new() .add_plugins(DefaultPlugins.set(WindowPlugin { primary_window: Some(Window { title: "I am a window!".into(), name: Some("SpaceGameCompany.SpaceShooter".into()), ..default() }), ..default() })) .run(); ``` --------- Co-authored-by: François <[email protected]>
# Objective - Fixes bevyengine#4188, make users could set application ID for bevy apps. ## Solution - Add `name` field to `bevy::window::Window`. Specifying this field adds different properties to the window: application ID on `Wayland`, `WM_CLASS` on `X11`, or window class name on Windows. It has no effect on other platforms. --- ## Changelog ### Added - Add `name` to `bevy::window::Window`. ## Migration Guide - Set the `bevy_window::Window`'s `name` field when needed: ```rust App::new() .add_plugins(DefaultPlugins.set(WindowPlugin { primary_window: Some(Window { title: "I am a window!".into(), name: Some("SpaceGameCompany.SpaceShooter".into()), ..default() }), ..default() })) .run(); ``` --------- Co-authored-by: François <[email protected]>
What problem does this solve or what need does it fill?
Field
.with_app_id()
is used to set App's ID to be accessed by Compositor to e.g. set specific rules for given window or group of windows under same id, for example enabling/disabling server-side opacity, disabling CSD, hardcoding tag/workspace on startup, setting position etc.What solution would you like?
What alternative(s) have you considered?
None.
Additional context
For now, every bevy game have
app_id
exposed as<NULL>
, there are programs like lswt or waylevel for querying info about connected clients and theirapp_id
, programs like that may not work under KDE/GNOME if they don't implement protocols which allow clients to query such info from Compositor.The text was updated successfully, but these errors were encountered: