Add `app_id` to `bevy::window::Window`
Objective
- Fixes #4188, make users could set application ID for bevy apps.
Solution
- Add
app_idtobevy::window::Window, which will make bevy callwinit::platform::wayland::WindowBuilderExtWayland::with_name()orwinit::platform::x11::WindowBuilderExtX11::with_name()when building the window, then the window will have a desired "application ID" property.
Changelog
Added
- Add
app_idtobevy::window::Window.
Migration Guide
- Set the
bevy_window::Window'sapp_id:
App::new()
.add_plugins(DefaultPlugins.set(WindowPlugin {
primary_window: Some(Window {
title: "I am a window!".into(),
app_id: "SpaceShooter.SpaceGameCompany".into(),
resolution: (500., 300.).into(),
..default()
}),
..default()
}))
.run();
is it an issue to have both x11 and wayland features enabled, and have both methods called?
is it an issue to have both x11 and wayland features enabled, and have both methods called?
From looking at the winit code, no: both of them set platform_specific.name in the same way.
I'm very sorry for such a long delay! After almost a year, I finally remembered this PR. I've rebased it onto the latest bevy and updated some documentation. The concept of application ID or wm_class is only applicable to UNIX platforms, and currently, winit does not provide a way to modify it after the app has started. This feature is quite for many window managers to manage windows. Please review the current code again, thank you very much!
The concept of application ID or wm_class is only applicable to UNIX platforms
The equivalent of this on Windows is window class names, which winit also supports:
@musjj Thanks! Didn't find this before. I will update this patch ASAP.