wayland: add prefer_csd attribute

This commit is contained in:
Timon 2025-10-24 12:35:51 +00:00 • committed by GitHub
parent 42d256e926
commit bd6fef1d80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 29 additions and 8 deletions

View file

@ -98,6 +98,7 @@ pub(crate) struct ApplicationName {
pub struct WindowAttributesWayland {
pub(crate) name: Option<ApplicationName>,
pub(crate) activation_token: Option<ActivationToken>,
pub(crate) prefer_csd: bool,
}
impl WindowAttributesWayland {
@ -119,6 +120,18 @@ impl WindowAttributesWayland {
self.activation_token = Some(token);
self
}
/// Builds the window with a given preference for client-side decorations.
///
/// When set to `true`, the window will tell the compositor that it prefers
/// client-side decorations, even if server-side decorations are available.
/// When set to `false` (the default), the window will indicate a preference
/// for server-side decorations.
#[inline]
pub fn with_prefer_csd(mut self, prefer_csd: bool) -> Self {
self.prefer_csd = prefer_csd;
self
}
}
impl PlatformWindowAttributes for WindowAttributesWayland {