Skip to content

Commit

Permalink
iOS: Clean up notes on main thread safety
Browse files Browse the repository at this point in the history
These platform-specific notes on `Window` methods were unnecessary, as
it's already discussed in the top-level `Window` docs.
  • Loading branch information
madsmtm committed Aug 18, 2024
1 parent 44cb7f4 commit 4d07130
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,6 @@ impl Window {
///
/// - **Windows** This API uses `RedrawWindow` to request a `WM_PAINT` message and
/// `RedrawRequested` is emitted in sync with any `WM_PAINT` messages.
/// - **iOS:** Can only be called on the main thread.
/// - **Wayland:** The events are aligned with the frame callbacks when
/// [`Window::pre_present_notify`] is used.
/// - **Web:** [`WindowEvent::RedrawRequested`] will be aligned with the
Expand Down Expand Up @@ -671,8 +670,8 @@ impl Window {
///
/// ## Platform-specific
///
/// - **iOS:** Can only be called on the main thread. Returns the top left coordinates of the
/// window's [safe area] in the screen space coordinate system.
/// - **iOS:** Returns the top left coordinates of the window's [safe area] in the screen space
/// coordinate system.
/// - **Web:** Returns the top-left coordinates relative to the viewport. _Note: this returns
/// the same value as [`Window::outer_position`]._
/// - **Android / Wayland:** Always returns [`NotSupportedError`].
Expand All @@ -697,8 +696,8 @@ impl Window {
///
/// ## Platform-specific
///
/// - **iOS:** Can only be called on the main thread. Returns the top left coordinates of the
/// window in the screen space coordinate system.
/// - **iOS:** Returns the top left coordinates of the window in the screen space coordinate
/// system.
/// - **Web:** Returns the top-left coordinates relative to the viewport.
/// - **Android / Wayland:** Always returns [`NotSupportedError`].
#[inline]
Expand Down Expand Up @@ -727,8 +726,8 @@ impl Window {
///
/// ## Platform-specific
///
/// - **iOS:** Can only be called on the main thread. Sets the top left coordinates of the
/// window in the screen space coordinate system.
/// - **iOS:** Sets the top left coordinates of the window in the screen space coordinate
/// system.
/// - **Web:** Sets the top-left coordinates relative to the viewport. Doesn't account for CSS
/// [`transform`].
/// - **Android / Wayland:** Unsupported.
Expand All @@ -752,8 +751,8 @@ impl Window {
///
/// ## Platform-specific
///
/// - **iOS:** Can only be called on the main thread. Returns the `PhysicalSize` of the window's
/// [safe area] in screen space coordinates.
/// - **iOS:** Returns the `PhysicalSize` of the window's [safe area] in screen space
/// coordinates.
/// - **Web:** Returns the size of the canvas element. Doesn't account for CSS [`transform`].
///
/// [safe area]: https://developer.apple.com/documentation/uikit/uiview/2891103-safeareainsets?language=objc
Expand Down Expand Up @@ -818,8 +817,7 @@ impl Window {
///
/// ## Platform-specific
///
/// - **iOS:** Can only be called on the main thread. Returns the [`PhysicalSize`] of the window
/// in screen space coordinates.
/// - **iOS:** Returns the [`PhysicalSize`] of the window in screen space coordinates.
/// - **Web:** Returns the size of the canvas element. _Note: this returns the same value as
/// [`Window::inner_size`]._
#[inline]
Expand Down Expand Up @@ -973,7 +971,6 @@ impl Window {
/// ## Platform-specific
///
/// - **Android / Wayland / Web:** Unsupported.
/// - **iOS:** Can only be called on the main thread.
#[inline]
pub fn set_visible(&self, visible: bool) {
let _span = tracing::debug_span!("winit::Window::set_visible", visible).entered();
Expand Down Expand Up @@ -1121,7 +1118,6 @@ impl Window {
/// separate spaces are not preferred.
///
/// The dock and the menu bar are disabled in exclusive fullscreen mode.
/// - **iOS:** Can only be called on the main thread.
/// - **Wayland:** Does not support exclusive fullscreen mode and will no-op a request.
/// - **Windows:** Screen saver is disabled in fullscreen mode.
/// - **Android / Orbital:** Unsupported.
Expand All @@ -1148,7 +1144,6 @@ impl Window {
///
/// ## Platform-specific
///
/// - **iOS:** Can only be called on the main thread.
/// - **Android / Orbital:** Will always return `None`.
/// - **Wayland:** Can return `Borderless(None)` when there are no monitors.
/// - **Web:** Can only return `None` or `Borderless`.
Expand Down

0 comments on commit 4d07130

Please sign in to comment.