Skip to content

Commit

Permalink
Clarify Window::set_decorations/is_decorated behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardy committed Jan 28, 2023
1 parent 42c395e commit c984476
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
5 changes: 1 addition & 4 deletions src/platform_impl/ios/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
12 changes: 9 additions & 3 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -941,20 +941,26 @@ 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)
}

/// 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()
Expand Down

0 comments on commit c984476

Please sign in to comment.