Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 2 additions & 0 deletions winit-core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions winit-core/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -634,7 +634,7 @@ pub enum ButtonSource {
/// [`Left`](MouseButton::Left) clicks as secondary when
/// [<kbd>CTRL</kbd>](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 <https://github.com/rust-windowing/winit/issues/4469>.
Mouse(MouseButton),
/// See [`PointerSource::Touch`] for more details.
///
Expand Down
6 changes: 3 additions & 3 deletions winit-core/src/window/positioner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: <https://wayland.app/protocols/xdg-shell#xdg_positioner:request:set_anchor_rect>
#[derive(Debug, Clone, Copy, Default, PartialEq)]
#[non_exhaustive]
pub enum WindowAnchor {
Expand All @@ -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: <https://wayland.app/protocols/xdg-shell#xdg_positioner:request:set_gravity>
#[derive(Debug, Clone, Copy, Default, PartialEq)]
#[non_exhaustive]
pub enum WindowGravity {
Expand All @@ -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: <https://wayland.app/protocols/xdg-shell#xdg_positioner:request:set_constraint_adjustment>
/// 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 {
Expand Down
3 changes: 1 addition & 2 deletions winit-wayland/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
52 changes: 26 additions & 26 deletions winit-web/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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
Expand All @@ -281,17 +281,17 @@ 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.
///
/// [`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;
}

Expand All @@ -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
Expand All @@ -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
Expand All @@ -348,15 +348,15 @@ 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.
///
/// [`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;
}

Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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.
///
Expand Down Expand Up @@ -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;
}

Expand Down
Loading