From c984476687ed30ab691f119d93b920d76472333e Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Sat, 28 Jan 2023 07:50:34 +0000 Subject: [PATCH] Clarify `Window::set_decorations/is_decorated` behaviour --- src/platform_impl/ios/window.rs | 5 +---- src/window.rs | 12 +++++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/platform_impl/ios/window.rs b/src/platform_impl/ios/window.rs index 22fbb2de1c..edcd89711e 100644 --- a/src/platform_impl/ios/window.rs +++ b/src/platform_impl/ios/window.rs @@ -281,12 +281,9 @@ impl Inner { } } - pub fn set_decorations(&self, _decorations: bool) { - warn!("`Window::set_decorations` is ignored on iOS") - } + pub fn set_decorations(&self, _decorations: bool) {} pub fn is_decorated(&self) -> bool { - warn!("`Window::is_decorated` is ignored on iOS"); true } diff --git a/src/window.rs b/src/window.rs index 6790d4ee49..0c3e90278f 100644 --- a/src/window.rs +++ b/src/window.rs @@ -941,9 +941,13 @@ impl Window { /// Turn window decorations on or off. /// + /// Enable/disable window decorations provided by the server or Winit. + /// By default this is enabled. Note that fullscreen windows and windows on + /// mobile and web platforms naturally do not have decorations. + /// /// ## Platform-specific /// - /// - **iOS / Android / Web:** Unsupported. + /// - **iOS / Android / Web:** No effect. #[inline] pub fn set_decorations(&self, decorations: bool) { self.window.set_decorations(decorations) @@ -951,10 +955,12 @@ impl Window { /// Gets the window's current decorations state. /// + /// Returns `true` when windows are decorated (server-side or by Winit). + /// Also returns `true` when no decorations are required (mobile, web). + /// /// ## Platform-specific /// - /// - **X11:** Not implemented. - /// - **iOS / Android / Web:** Unsupported. + /// - **iOS / Android / Web:** Always returns `true`. #[inline] pub fn is_decorated(&self) -> bool { self.window.is_decorated()