mirror of
https://github.com/rust-windowing/winit.git
synced 2026-09-02 06:40:06 -04:00
chore: Housekeeping
- Update CHANGELOG - Add documentation to items I forgot to document - Trait implementations Signed-off-by: John Nunley <dev@notgull.net>
This commit is contained in:
@@ -49,6 +49,14 @@ Unreleased` header.
|
|||||||
- On Wayland, fix `Window::set_{min,max}_inner_size` not always applied.
|
- On Wayland, fix `Window::set_{min,max}_inner_size` not always applied.
|
||||||
- On Windows, fix inconsistent resizing behavior with multi-monitor setups when repositioning outside the event loop.
|
- On Windows, fix inconsistent resizing behavior with multi-monitor setups when repositioning outside the event loop.
|
||||||
- On Wayland, fix `WAYLAND_SOCKET` not used when detecting platform.
|
- On Wayland, fix `WAYLAND_SOCKET` not used when detecting platform.
|
||||||
|
- **Breaking:** Move some types to the `winit-core` crate. Most types are
|
||||||
|
re-exported verbatim; however:
|
||||||
|
- `Event`, `WindowEvent` and `KeyEvent` now take a generic that `winit`
|
||||||
|
implements.
|
||||||
|
- `ActivationToken` and `InnerSizeWriter` expose new methods to make them
|
||||||
|
useful.
|
||||||
|
- `InnerSizeWriter::request_inner_size` returns an `InnerSizeIgnored` error
|
||||||
|
instead of an `ExternalError`.
|
||||||
|
|
||||||
# 0.29.10
|
# 0.29.10
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ resolver = "2"
|
|||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
bitflags = "2"
|
bitflags = "2"
|
||||||
|
cfg_aliases = "0.2.0"
|
||||||
cursor-icon = "1.1.0"
|
cursor-icon = "1.1.0"
|
||||||
serde = { version = "1", features = ["serde_derive"] }
|
serde = { version = "1", features = ["serde_derive"] }
|
||||||
smol_str = "0.2.0"
|
smol_str = "0.2.0"
|
||||||
|
web-time = "1"
|
||||||
winit-core = { path = "./winit-core", default-features = false, features = ["std"] }
|
winit-core = { path = "./winit-core", default-features = false, features = ["std"] }
|
||||||
|
|||||||
@@ -21,9 +21,12 @@ serde = ["dep:serde", "cursor-icon/serde", "smol_str/serde"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
bitflags.workspace = true
|
bitflags.workspace = true
|
||||||
cursor-icon.workspace = true
|
cursor-icon.workspace = true
|
||||||
|
mint = { version = "0.5.6", optional = true }
|
||||||
serde = { workspace = true, optional = true }
|
serde = { workspace = true, optional = true }
|
||||||
smol_str.workspace = true
|
smol_str.workspace = true
|
||||||
web-time = "1"
|
|
||||||
|
[target.'cfg(target_family = "wasm")'.dependencies]
|
||||||
|
web-time.workspace = true
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
cfg_aliases = "0.2.0"
|
cfg_aliases.workspace = true
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ use std::time::Instant;
|
|||||||
#[cfg(web_platform)]
|
#[cfg(web_platform)]
|
||||||
use web_time::Instant;
|
use web_time::Instant;
|
||||||
|
|
||||||
|
#[cfg(feature = "serde")]
|
||||||
|
pub use serde::{Serialize, Deserialize};
|
||||||
|
|
||||||
use smol_str::SmolStr;
|
use smol_str::SmolStr;
|
||||||
|
|
||||||
/// Identifier of an input device.
|
/// Identifier of an input device.
|
||||||
@@ -778,6 +781,7 @@ pub struct Modifiers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Modifiers {
|
impl Modifiers {
|
||||||
|
/// Only `winit` should instantiate this!
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub fn new(state: ModifiersState, pressed_mods: ModifiersKeys) -> Self {
|
pub fn new(state: ModifiersState, pressed_mods: ModifiersKeys) -> Self {
|
||||||
Self {
|
Self {
|
||||||
@@ -1120,6 +1124,7 @@ impl InnerSizeWriter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get the underlying size.
|
||||||
pub fn get(&self) -> PhysicalSize<u32> {
|
pub fn get(&self) -> PhysicalSize<u32> {
|
||||||
*self.new_inner_size.upgrade().unwrap().lock().unwrap()
|
*self.new_inner_size.upgrade().unwrap().lock().unwrap()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use cursor_icon::{CursorIcon, ParseError as CursorIconParseError};
|
pub use cursor_icon::{CursorIcon, ParseError as CursorIconParseError};
|
||||||
|
|
||||||
|
#[cfg(feature = "serde")]
|
||||||
|
pub use serde::{Serialize, Deserialize};
|
||||||
|
|
||||||
/// Identifier of a window. Unique for each window.
|
/// Identifier of a window. Unique for each window.
|
||||||
///
|
///
|
||||||
/// Can be obtained with [`window.id()`](`Window::id`).
|
/// Can be obtained with [`window.id()`](`Window::id`).
|
||||||
@@ -192,7 +195,7 @@ impl Default for ImePurpose {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An opaque token used to activate the [`Window`].
|
/// An stringly-typed token used to activate the [`Window`].
|
||||||
///
|
///
|
||||||
/// [`Window`]: crate::window::Window
|
/// [`Window`]: crate::window::Window
|
||||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||||
@@ -201,14 +204,17 @@ pub struct ActivationToken {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl ActivationToken {
|
impl ActivationToken {
|
||||||
pub fn new(_token: String) -> Self {
|
/// Create a new [`ActivationToken`].
|
||||||
Self { token: _token }
|
pub fn new(token: String) -> Self {
|
||||||
|
Self { token }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get the underlying token.
|
||||||
pub fn token(&self) -> &str {
|
pub fn token(&self) -> &str {
|
||||||
&self.token
|
&self.token
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Convert into the underlying token.
|
||||||
pub fn into_token(self) -> String {
|
pub fn into_token(self) -> String {
|
||||||
self.token
|
self.token
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,19 +52,19 @@ wayland-csd-adwaita-crossfont = ["sctk-adwaita", "sctk-adwaita/crossfont"]
|
|||||||
wayland-csd-adwaita-notitle = ["sctk-adwaita"]
|
wayland-csd-adwaita-notitle = ["sctk-adwaita"]
|
||||||
android-native-activity = ["android-activity/native-activity"]
|
android-native-activity = ["android-activity/native-activity"]
|
||||||
android-game-activity = ["android-activity/game-activity"]
|
android-game-activity = ["android-activity/game-activity"]
|
||||||
serde = ["dep:serde", "cursor-icon/serde", "smol_str/serde"]
|
mint = ["winit-core/mint"]
|
||||||
|
serde = ["dep:serde", "winit-core/serde", "cursor-icon/serde", "smol_str/serde"]
|
||||||
rwh_04 = ["dep:rwh_04", "ndk/rwh_04"]
|
rwh_04 = ["dep:rwh_04", "ndk/rwh_04"]
|
||||||
rwh_05 = ["dep:rwh_05", "ndk/rwh_05"]
|
rwh_05 = ["dep:rwh_05", "ndk/rwh_05"]
|
||||||
rwh_06 = ["dep:rwh_06", "ndk/rwh_06"]
|
rwh_06 = ["dep:rwh_06", "ndk/rwh_06"]
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
cfg_aliases = "0.2.0"
|
cfg_aliases.workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bitflags.workspace = true
|
bitflags.workspace = true
|
||||||
cursor-icon.workspace = true
|
cursor-icon.workspace = true
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
mint = { version = "0.5.6", optional = true }
|
|
||||||
once_cell = "1.12"
|
once_cell = "1.12"
|
||||||
rwh_04 = { package = "raw-window-handle", version = "0.4", optional = true }
|
rwh_04 = { package = "raw-window-handle", version = "0.4", optional = true }
|
||||||
rwh_05 = { package = "raw-window-handle", version = "0.5.2", features = ["std"], optional = true }
|
rwh_05 = { package = "raw-window-handle", version = "0.5.2", features = ["std"], optional = true }
|
||||||
@@ -246,7 +246,7 @@ js-sys = "0.3.64"
|
|||||||
pin-project = "1"
|
pin-project = "1"
|
||||||
wasm-bindgen = "0.2"
|
wasm-bindgen = "0.2"
|
||||||
wasm-bindgen-futures = "0.4"
|
wasm-bindgen-futures = "0.4"
|
||||||
web-time = "1"
|
web-time.workspace = true
|
||||||
|
|
||||||
[target.'cfg(all(target_family = "wasm", target_feature = "atomics"))'.dependencies]
|
[target.'cfg(all(target_family = "wasm", target_feature = "atomics"))'.dependencies]
|
||||||
atomic-waker = "1"
|
atomic-waker = "1"
|
||||||
|
|||||||
@@ -16,6 +16,12 @@ pub enum ExternalError {
|
|||||||
Os(OsError),
|
Os(OsError),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<winit_core::event::InnerSizeIgnored> for ExternalError {
|
||||||
|
fn from(_: winit_core::event::InnerSizeIgnored) -> Self {
|
||||||
|
Self::Ignored
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// The error type for when the OS cannot perform the requested operation.
|
/// The error type for when the OS cannot perform the requested operation.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct OsError {
|
pub struct OsError {
|
||||||
|
|||||||
@@ -14,9 +14,6 @@ pub use crate::icon::{BadIcon, Icon};
|
|||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use winit_core::window::*;
|
pub use winit_core::window::*;
|
||||||
|
|
||||||
#[cfg(feature = "serde")]
|
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
|
|
||||||
/// Represents a window.
|
/// Represents a window.
|
||||||
///
|
///
|
||||||
/// The window is closed when dropped.
|
/// The window is closed when dropped.
|
||||||
|
|||||||
Reference in New Issue
Block a user