Introduce WindowBuilderExt::with_app_id for wayland (#700)

This commit is contained in:
Victor Berger 2018-11-15 22:59:56 +01:00 committed by Francesca Plebani
parent 8dcd514393
commit 7fe90e6c80
4 changed files with 22 additions and 3 deletions

View file

@ -225,6 +225,13 @@ pub trait WindowBuilderExt {
fn with_resize_increments(self, increments: LogicalSize) -> WindowBuilder;
/// Build window with base size hint. Only implemented on X11.
fn with_base_size(self, base_size: LogicalSize) -> WindowBuilder;
/// Build window with a given application ID. It should match the `.desktop` file distributed with
/// your program. Only relevant on Wayland.
///
/// For details about application ID conventions, see the
/// [Desktop Entry Spec](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#desktop-file-id)
fn with_app_id(self, app_id: String) -> WindowBuilder;
}
impl WindowBuilderExt for WindowBuilder {
@ -277,6 +284,12 @@ impl WindowBuilderExt for WindowBuilder {
self.platform_specific.gtk_theme_variant = Some(variant);
self
}
#[inline]
fn with_app_id(mut self, app_id: String) -> WindowBuilder {
self.platform_specific.app_id = Some(app_id);
self
}
}
/// Additional methods on `MonitorId` that are specific to Linux.