diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 64bf022674..c33fce443a 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -276,7 +276,7 @@ jobs:
- name: Check docs.rs documentation
if: matrix.toolchain == 'nightly'
- run: cargo doc --no-deps $OPTIONS --features=serde,mint,android-native-activity
+ run: cargo doc --no-deps $OPTIONS --features=serde,mint,android-native-activity --workspace
env:
RUSTDOCFLAGS: '--deny=warnings ${{ matrix.platform.rustflags }} --cfg=docsrs --cfg=unreleased_changelogs'
diff --git a/winit-core/src/error.rs b/winit-core/src/error.rs
index bf769cae11..fd743aedcf 100644
--- a/winit-core/src/error.rs
+++ b/winit-core/src/error.rs
@@ -2,6 +2,8 @@ use std::error::Error;
use std::fmt::{self, Display};
use crate::data_transfer::DataTransferId;
+#[allow(unused, reason = "used in docs only")]
+use crate::{cursor::CustomCursorSource, window::WindowType};
/// A general error that may occur while running or creating
/// the event loop.
diff --git a/winit-core/src/event.rs b/winit-core/src/event.rs
index f0de841064..65d478edd9 100644
--- a/winit-core/src/event.rs
+++ b/winit-core/src/event.rs
@@ -14,7 +14,7 @@ use crate::data_transfer::{DataTransferId, TypedData};
use crate::error::InternalError;
use crate::event_loop::{AsyncRequestSerial, DndAction};
use crate::keyboard::{self, ModifiersKeyState, ModifiersKeys, ModifiersState};
-#[cfg(doc)]
+#[allow(unused, reason = "used in docs only")]
use crate::window::Window;
use crate::window::{ActivationToken, Theme};
@@ -634,7 +634,7 @@ pub enum ButtonSource {
/// [`Left`](MouseButton::Left) clicks as secondary when
/// [CTRL](ModifiersState::CONTROL) is held and their internal logic deems it
/// appropriate for the content under the pointer.
- /// See also https://github.com/rust-windowing/winit/issues/4469.
+ /// See also .
Mouse(MouseButton),
/// See [`PointerSource::Touch`] for more details.
///
diff --git a/winit-core/src/window/positioner.rs b/winit-core/src/window/positioner.rs
index 297cf44faa..0d1e991a28 100644
--- a/winit-core/src/window/positioner.rs
+++ b/winit-core/src/window/positioner.rs
@@ -5,7 +5,7 @@
//! Wayland's `xdg_positioner` (such as Win32 and AppKit) and isn't part of winit's public API.
/// Anchor rect within the parent surface
-/// See: https://wayland.app/protocols/xdg-shell#xdg_positioner:request:set_anchor_rect
+/// See:
#[derive(Debug, Clone, Copy, Default, PartialEq)]
#[non_exhaustive]
pub enum WindowAnchor {
@@ -22,7 +22,7 @@ pub enum WindowAnchor {
}
/// Defines in what direction a surface should be positioned
-/// See: https://wayland.app/protocols/xdg-shell#xdg_positioner:request:set_gravity
+/// See:
#[derive(Debug, Clone, Copy, Default, PartialEq)]
#[non_exhaustive]
pub enum WindowGravity {
@@ -40,7 +40,7 @@ pub enum WindowGravity {
bitflags::bitflags! {
/// Specify how the window should be positioned if the originally intended position caused the
- /// surface to be constrained See: https://wayland.app/protocols/xdg-shell#xdg_positioner:request:set_constraint_adjustment
+ /// surface to be constrained See:
/// For all other platforms than wayland the behaviour is simulated on the winit side
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
pub struct WindowConstraintAdjustment: u32 {
diff --git a/winit-wayland/src/lib.rs b/winit-wayland/src/lib.rs
index 113e2b074c..ae668ad4ad 100644
--- a/winit-wayland/src/lib.rs
+++ b/winit-wayland/src/lib.rs
@@ -129,8 +129,7 @@ impl WindowAttributesWayland {
/// Sets an activation token to use when creating the window.
///
/// The activation token allows the compositor to grant focus to the new window,
- /// overriding focus-stealing prevention. Obtain a token via
- /// [`ActiveEventLoop::request_activation_token`].
+ /// overriding focus-stealing prevention.
#[inline]
pub fn with_activation_token(mut self, token: ActivationToken) -> Self {
self.activation_token = Some(token);
diff --git a/winit-web/src/lib.rs b/winit-web/src/lib.rs
index 0b4d406433..f4f01c9c0e 100644
--- a/winit-web/src/lib.rs
+++ b/winit-web/src/lib.rs
@@ -33,13 +33,13 @@
//! [`WindowEvent::PointerLeft`].
//! - [`Window::set_outer_position()`]
//!
-//! [`WindowEvent::SurfaceResized`]: crate::event::WindowEvent::SurfaceResized
-//! [`Window::(set_)surface_size()`]: crate::window::Window::surface_size
-//! [`WindowEvent::Occluded`]: crate::event::WindowEvent::Occluded
-//! [`WindowEvent::PointerMoved`]: crate::event::WindowEvent::PointerMoved
-//! [`WindowEvent::PointerEntered`]: crate::event::WindowEvent::PointerEntered
-//! [`WindowEvent::PointerLeft`]: crate::event::WindowEvent::PointerLeft
-//! [`Window::set_outer_position()`]: crate::window::Window::set_outer_position
+//! [`WindowEvent::SurfaceResized`]: winit_core::event::WindowEvent::SurfaceResized
+//! [`Window::(set_)surface_size()`]: winit_core::window::Window::surface_size
+//! [`WindowEvent::Occluded`]: winit_core::event::WindowEvent::Occluded
+//! [`WindowEvent::PointerMoved`]: winit_core::event::WindowEvent::PointerMoved
+//! [`WindowEvent::PointerEntered`]: winit_core::event::WindowEvent::PointerEntered
+//! [`WindowEvent::PointerLeft`]: winit_core::event::WindowEvent::PointerLeft
+//! [`Window::set_outer_position()`]: winit_core::window::Window::set_outer_position
#![warn(clippy::exhaustive_enums)]
@@ -130,7 +130,7 @@ pub trait WindowExtWeb {
/// This is the same as [`ActiveEventLoopExtWeb::is_cursor_lock_raw()`], and is provided for
/// convenience.
///
- /// [`CursorGrabMode::Locked`]: crate::window::CursorGrabMode::Locked
+ /// [`CursorGrabMode::Locked`]: winit_core::window::CursorGrabMode::Locked
fn is_cursor_lock_raw(&self) -> bool;
}
@@ -242,28 +242,28 @@ pub trait EventLoopExtWeb {
///
/// See [`PollStrategy`].
///
- /// [`ControlFlow::Poll`]: crate::event_loop::ControlFlow::Poll
+ /// [`ControlFlow::Poll`]: winit_core::event_loop::ControlFlow::Poll
fn set_poll_strategy(&self, strategy: PollStrategy);
/// Gets the strategy for [`ControlFlow::Poll`].
///
/// See [`PollStrategy`].
///
- /// [`ControlFlow::Poll`]: crate::event_loop::ControlFlow::Poll
+ /// [`ControlFlow::Poll`]: winit_core::event_loop::ControlFlow::Poll
fn poll_strategy(&self) -> PollStrategy;
/// Sets the strategy for [`ControlFlow::WaitUntil`].
///
/// See [`WaitUntilStrategy`].
///
- /// [`ControlFlow::WaitUntil`]: crate::event_loop::ControlFlow::WaitUntil
+ /// [`ControlFlow::WaitUntil`]: winit_core::event_loop::ControlFlow::WaitUntil
fn set_wait_until_strategy(&self, strategy: WaitUntilStrategy);
/// Gets the strategy for [`ControlFlow::WaitUntil`].
///
/// See [`WaitUntilStrategy`].
///
- /// [`ControlFlow::WaitUntil`]: crate::event_loop::ControlFlow::WaitUntil
+ /// [`ControlFlow::WaitUntil`]: winit_core::event_loop::ControlFlow::WaitUntil
fn wait_until_strategy(&self) -> WaitUntilStrategy;
/// Returns if the users device has multiple screens. Useful to check before prompting the user
@@ -281,7 +281,7 @@ pub trait EventLoopExtWeb {
/// [`MonitorHandle`]s don't automatically make use of this after permission is granted. New
/// [`MonitorHandle`]s have to be created instead.
///
- /// [`MonitorHandle`]: crate::monitor::MonitorHandle
+ /// [`MonitorHandle`]: winit_core::monitor::MonitorHandle
fn request_detailed_monitor_permission(&self) -> MonitorPermissionFuture;
/// Returns whether the user has given permission to access detailed monitor information.
@@ -289,9 +289,9 @@ pub trait EventLoopExtWeb {
/// [`MonitorHandle`]s don't automatically make use of detailed monitor information after
/// permission is granted. New [`MonitorHandle`]s have to be created instead.
///
- /// [`MonitorHandle`]: crate::monitor::MonitorHandle
+ /// [`MonitorHandle`]: winit_core::monitor::MonitorHandle
///
- /// [`MonitorHandle`]: crate::monitor::MonitorHandle
+ /// [`MonitorHandle`]: winit_core::monitor::MonitorHandle
fn has_detailed_monitor_permission(&self) -> HasMonitorPermissionFuture;
}
@@ -300,28 +300,28 @@ pub trait ActiveEventLoopExtWeb {
///
/// See [`PollStrategy`].
///
- /// [`ControlFlow::Poll`]: crate::event_loop::ControlFlow::Poll
+ /// [`ControlFlow::Poll`]: winit_core::event_loop::ControlFlow::Poll
fn set_poll_strategy(&self, strategy: PollStrategy);
/// Gets the strategy for [`ControlFlow::Poll`].
///
/// See [`PollStrategy`].
///
- /// [`ControlFlow::Poll`]: crate::event_loop::ControlFlow::Poll
+ /// [`ControlFlow::Poll`]: winit_core::event_loop::ControlFlow::Poll
fn poll_strategy(&self) -> PollStrategy;
/// Sets the strategy for [`ControlFlow::WaitUntil`].
///
/// See [`WaitUntilStrategy`].
///
- /// [`ControlFlow::WaitUntil`]: crate::event_loop::ControlFlow::WaitUntil
+ /// [`ControlFlow::WaitUntil`]: winit_core::event_loop::ControlFlow::WaitUntil
fn set_wait_until_strategy(&self, strategy: WaitUntilStrategy);
/// Gets the strategy for [`ControlFlow::WaitUntil`].
///
/// See [`WaitUntilStrategy`].
///
- /// [`ControlFlow::WaitUntil`]: crate::event_loop::ControlFlow::WaitUntil
+ /// [`ControlFlow::WaitUntil`]: winit_core::event_loop::ControlFlow::WaitUntil
fn wait_until_strategy(&self) -> WaitUntilStrategy;
/// Async version of [`ActiveEventLoop::create_custom_cursor()`] which waits until the
@@ -330,7 +330,7 @@ pub trait ActiveEventLoopExtWeb {
/// Returns whether using [`CursorGrabMode::Locked`] returns raw, un-accelerated mouse input.
///
- /// [`CursorGrabMode::Locked`]: crate::window::CursorGrabMode::Locked
+ /// [`CursorGrabMode::Locked`]: winit_core::window::CursorGrabMode::Locked
fn is_cursor_lock_raw(&self) -> bool;
/// Returns if the users device has multiple screens. Useful to check before prompting the user
@@ -348,7 +348,7 @@ pub trait ActiveEventLoopExtWeb {
/// [`MonitorHandle`]s don't automatically make use of this after permission is granted. New
/// [`MonitorHandle`]s have to be created instead.
///
- /// [`MonitorHandle`]: crate::monitor::MonitorHandle
+ /// [`MonitorHandle`]: winit_core::monitor::MonitorHandle
fn request_detailed_monitor_permission(&self) -> MonitorPermissionFuture;
/// Returns whether the user has given permission to access detailed monitor information.
@@ -356,7 +356,7 @@ pub trait ActiveEventLoopExtWeb {
/// [`MonitorHandle`]s don't automatically make use of detailed monitor information after
/// permission is granted. New [`MonitorHandle`]s have to be created instead.
///
- /// [`MonitorHandle`]: crate::monitor::MonitorHandle
+ /// [`MonitorHandle`]: winit_core::monitor::MonitorHandle
fn has_detailed_monitor_permission(&self) -> bool;
}
@@ -416,7 +416,7 @@ impl ActiveEventLoopExtWeb for dyn ActiveEventLoop + '_ {
}
}
-/// Strategy used for [`ControlFlow::Poll`][crate::event_loop::ControlFlow::Poll].
+/// Strategy used for [`ControlFlow::Poll`][winit_core::event_loop::ControlFlow::Poll].
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[non_exhaustive]
@@ -444,7 +444,7 @@ pub enum PollStrategy {
Scheduler,
}
-/// Strategy used for [`ControlFlow::WaitUntil`][crate::event_loop::ControlFlow::WaitUntil].
+/// Strategy used for [`ControlFlow::WaitUntil`][winit_core::event_loop::ControlFlow::WaitUntil].
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[non_exhaustive]
@@ -555,7 +555,7 @@ impl Future for HasMonitorPermissionFuture {
/// Additional methods on [`MonitorHandle`] that are specific to the Web.
///
-/// [`MonitorHandle`]: crate::monitor::MonitorHandle
+/// [`MonitorHandle`]: winit_core::monitor::MonitorHandle
pub trait MonitorHandleExtWeb {
/// Returns whether the screen is internal to the device or external.
///
@@ -584,7 +584,7 @@ pub trait MonitorHandleExtWeb {
///
/// See [`ActiveEventLoopExtWeb::request_detailed_monitor_permission()`].
///
- /// [`MonitorHandle`]: crate::monitor::MonitorHandle
+ /// [`MonitorHandle`]: winit_core::monitor::MonitorHandle
fn is_detailed(&self) -> bool;
}