-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add app id setting for linux #1963
Conversation
#[cfg(target_os = "linux")] | ||
{ | ||
#[cfg(feature = "x11")] | ||
{ | ||
use winit::platform::x11::WindowBuilderExtX11; | ||
|
||
window_builder = window_builder.with_name( | ||
&self.platform_specific.application_id, | ||
&self.platform_specific.application_id, | ||
); | ||
} | ||
#[cfg(feature = "wayland")] | ||
{ | ||
use winit::platform::wayland::WindowBuilderExtWayland; | ||
|
||
window_builder = window_builder.with_name( | ||
&self.platform_specific.application_id, | ||
&self.platform_specific.application_id, | ||
); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This technically sets the same field twice by default since both features are enabled. I confirmed they both set the same field internally, but I felt this was easier to read than 3 different sets of cfg
attributes to determine which import is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks 🙇
This adds a new platform specific window setting on linux to set
application_id
. This allows the user to reliably tie their application to the XDG spec for.desktop
file, where icon can be specified.Without this, the application id (on X11, this is WMClass) is set to the executable name so renaming the application breaks proper
.desktop
usage.