Clarify Window::set_decorations/is_decorated behaviour

This commit is contained in:
Diggory Hardy 2023-01-28 07:50:34 +00:00 committed by GitHub
parent 42c395e49d
commit c984476687
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View file

@ -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
}

View file

@ -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()