Add app id setting for linux#1963
Merged
Merged
Conversation
tarkah
commented
Jul 21, 2023
Comment on lines
+199
to
+220
| #[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, | ||
| ); | ||
| } | ||
| } | ||
|
|
Member
Author
There was a problem hiding this comment.
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.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.desktopfile, 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
.desktopusage.