diff --git a/src/app/mod.rs b/src/app/mod.rs index 5f814214..21274206 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -123,6 +123,14 @@ pub(crate) fn iced_settings( } iced.window.decorations = !settings.client_decorations; iced.window.size = settings.size; + let min_size = settings.size_limits.min(); + if min_size != iced::Size::ZERO { + iced.window.min_size = Some(min_size); + } + let max_size = settings.size_limits.max(); + if max_size != iced::Size::INFINITY { + iced.window.max_size = Some(max_size); + } iced.window.transparent = settings.transparent; } diff --git a/src/app/settings.rs b/src/app/settings.rs index 0606216d..48bdd729 100644 --- a/src/app/settings.rs +++ b/src/app/settings.rs @@ -4,7 +4,6 @@ //! Configure a new COSMIC application. use crate::{font, Theme}; -#[cfg(feature = "wayland")] use iced_core::layout::Limits; use iced_core::Font; @@ -51,7 +50,6 @@ pub struct Settings { pub(crate) size: iced::Size, /// Limitations of the window size - #[cfg(feature = "wayland")] pub(crate) size_limits: Limits, /// The theme to apply to the application. @@ -92,7 +90,6 @@ impl Default for Settings { .and_then(|scale| scale.parse::().ok()) .unwrap_or(1.0), size: iced::Size::new(1024.0, 768.0), - #[cfg(feature = "wayland")] size_limits: Limits::NONE.min_height(1.0).min_width(1.0), theme: crate::theme::system_preference(), transparent: true,