diff options
| author | 2023-07-21 13:57:49 -0700 | |
|---|---|---|
| committer | 2023-07-26 20:14:52 +0200 | |
| commit | 94e991a785eddcc1c706a5a7111e1e88b18aef41 (patch) | |
| tree | 8e46ae79bad3af25740355635ebeea2f110c2af2 /winit/src | |
| parent | 6d5b69d307f1a65b1e9ad3baa5930aba67cd6293 (diff) | |
| download | iced-94e991a785eddcc1c706a5a7111e1e88b18aef41.tar.gz iced-94e991a785eddcc1c706a5a7111e1e88b18aef41.tar.bz2 iced-94e991a785eddcc1c706a5a7111e1e88b18aef41.zip  | |
Add app id setting for linux
Diffstat (limited to 'winit/src')
| -rw-r--r-- | winit/src/settings.rs | 28 | ||||
| -rw-r--r-- | winit/src/settings/linux.rs | 11 | 
2 files changed, 38 insertions, 1 deletions
diff --git a/winit/src/settings.rs b/winit/src/settings.rs index 40b3d487..8d3e1b47 100644 --- a/winit/src/settings.rs +++ b/winit/src/settings.rs @@ -7,6 +7,10 @@ mod platform;  #[path = "settings/macos.rs"]  mod platform; +#[cfg(target_os = "linux")] +#[path = "settings/linux.rs"] +mod platform; +  #[cfg(target_arch = "wasm32")]  #[path = "settings/wasm.rs"]  mod platform; @@ -14,6 +18,7 @@ mod platform;  #[cfg(not(any(      target_os = "windows",      target_os = "macos", +    target_os = "linux",      target_arch = "wasm32"  )))]  #[path = "settings/other.rs"] @@ -150,7 +155,6 @@ impl Window {          }          #[cfg(any( -            target_os = "linux",              target_os = "dragonfly",              target_os = "freebsd",              target_os = "netbsd", @@ -192,6 +196,28 @@ impl Window {                  );          } +        #[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, +                ); +            } +        } +          window_builder      }  } diff --git a/winit/src/settings/linux.rs b/winit/src/settings/linux.rs new file mode 100644 index 00000000..009b9d9e --- /dev/null +++ b/winit/src/settings/linux.rs @@ -0,0 +1,11 @@ +//! Platform specific settings for Linux. + +/// The platform specific window settings of an application. +#[derive(Debug, Clone, PartialEq, Eq, Default)] +pub struct PlatformSpecific { +    /// Sets the application id of the window. +    /// +    /// As a best practice, it is suggested to select an application id that match +    /// the basename of the application’s .desktop file. +    pub application_id: String, +}  | 
