diff options
author | 2021-08-11 20:15:49 +0700 | |
---|---|---|
committer | 2021-08-11 20:15:49 +0700 | |
commit | 3d640632f124294218442b2494282603a6f2919c (patch) | |
tree | bb4881a08b483bca5b356f8d2c1aac7c454c8352 /winit | |
parent | 45778ed598c0d202f8e86c47a444fd671fb3abce (diff) | |
parent | 7337ab63bc9e167116f8adbfedb5a8e8203a4a5b (diff) | |
download | iced-3d640632f124294218442b2494282603a6f2919c.tar.gz iced-3d640632f124294218442b2494282603a6f2919c.tar.bz2 iced-3d640632f124294218442b2494282603a6f2919c.zip |
Merge pull request #599 from oknozor/wayland-app-id
Add wayland app_id
Diffstat (limited to '')
-rw-r--r-- | winit/src/application.rs | 1 | ||||
-rw-r--r-- | winit/src/settings.rs | 23 |
2 files changed, 24 insertions, 0 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs index 1d32a5f3..c43eed11 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -152,6 +152,7 @@ where &application.title(), application.mode(), event_loop.primary_monitor(), + settings.id, ) .with_menu(Some(conversion::menu(&application.menu()))) .build(&event_loop) diff --git a/winit/src/settings.rs b/winit/src/settings.rs index 743f79bc..72a1a24a 100644 --- a/winit/src/settings.rs +++ b/winit/src/settings.rs @@ -16,6 +16,12 @@ use winit::window::WindowBuilder; /// The settings of an application. #[derive(Debug, Clone, Default)] pub struct Settings<Flags> { + /// The identifier of the application. + /// + /// If provided, this identifier may be used to identify the application or + /// communicate with it through the windowing system. + pub id: Option<String>, + /// The [`Window`] settings pub window: Window, @@ -70,6 +76,7 @@ impl Window { title: &str, mode: Mode, primary_monitor: Option<MonitorHandle>, + _id: Option<String>, ) -> WindowBuilder { let mut window_builder = WindowBuilder::new(); @@ -103,6 +110,21 @@ impl Window { .with_max_inner_size(winit::dpi::LogicalSize { width, height }); } + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + { + use ::winit::platform::unix::WindowBuilderExtUnix; + + if let Some(id) = _id { + window_builder = window_builder.with_app_id(id); + } + } + #[cfg(target_os = "windows")] { use winit::platform::windows::WindowBuilderExtWindows; @@ -110,6 +132,7 @@ impl Window { if let Some(parent) = self.platform_specific.parent { window_builder = window_builder.with_parent_window(parent); } + window_builder = window_builder .with_drag_and_drop(self.platform_specific.drag_and_drop); } |