Skip to content
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

Merged
merged 2 commits into from Jul 26, 2023
Merged

Add app id setting for linux #1963

merged 2 commits into from Jul 26, 2023

Conversation

tarkah
Copy link
Member

@tarkah tarkah commented Jul 21, 2023

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.

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,
);
}
}

Copy link
Member Author

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.

Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks 🙇

@hecrj hecrj added the feature New feature or request label Jul 26, 2023
@hecrj hecrj added this to the 0.10.0 milestone Jul 26, 2023
@hecrj hecrj added the shell label Jul 26, 2023
@hecrj hecrj enabled auto-merge July 26, 2023 18:16
@hecrj hecrj merged commit 07f091d into iced-rs:master Jul 26, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request shell
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants