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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ unicode-segmentation = "1.7.1"
windows-sys = "0.59.0"

# Linux dependencies.
ahash = { version = "0.8.7", features = ["no-rng"] }
bytemuck = { version = "1.13.1", default-features = false }
calloop = "0.14.3"
foldhash = { version = "0.2.0", default-features = false, features = ["std"] }
libc = "0.2.64"
memmap2 = "0.9.0"
percent-encoding = "2.0"
Expand Down
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ allow = [
"ISC", # https://tldrlegal.com/license/isc-license
"MIT", # https://tldrlegal.com/license/mit-license
"Unicode-3.0", # https://spdx.org/licenses/Unicode-3.0.html
"Zlib", # https://spdx.org/licenses/Zlib.html
]
confidence-threshold = 1.0
private = { ignore = true }
Expand Down
2 changes: 1 addition & 1 deletion winit-wayland/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ tracing.workspace = true
winit-core.workspace = true

# Platform-specific
ahash.workspace = true
calloop.workspace = true
foldhash.workspace = true
libc.workspace = true
memmap2.workspace = true
rustix = { workspace = true, features = ["std", "system", "thread", "process", "event", "pipe"] }
Expand Down
3 changes: 3 additions & 0 deletions winit-wayland/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
//! * `wayland-csd-adwaita-crossfont`.
//! * `wayland-csd-adwaita-notitle`.
//! * `wayland-csd-adwaita-notitlebar`.
#![allow(clippy::mutable_key_type)]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: See if there's a way to resolve this from the wayland-rs end


use std::ffi::c_void;
use std::ptr::NonNull;

Expand Down
4 changes: 2 additions & 2 deletions winit-wayland/src/seat/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use std::sync::Arc;

use ahash::AHashMap;
use foldhash::HashMap;
use sctk::reexports::client::backend::ObjectId;
use sctk::reexports::client::protocol::wl_seat::WlSeat;
use sctk::reexports::client::protocol::wl_touch::WlTouch;
Expand Down Expand Up @@ -43,7 +43,7 @@ pub struct WinitSeatState {
touch: Option<WlTouch>,

/// The mapping from touched points to the surfaces they're present.
touch_map: AHashMap<i32, TouchPoint>,
touch_map: HashMap<i32, TouchPoint>,

/// Id of the first touch event.
first_touch_id: Option<i32>,
Expand Down
12 changes: 6 additions & 6 deletions winit-wayland/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::cell::RefCell;
use std::sync::atomic::Ordering;
use std::sync::{Arc, Mutex};

use ahash::AHashMap;
use foldhash::HashMap;
use sctk::compositor::{CompositorHandler, CompositorState};
use sctk::output::{OutputHandler, OutputState};
use sctk::reexports::calloop::LoopHandle;
Expand Down Expand Up @@ -62,10 +62,10 @@ pub struct WinitState {
pub xdg_shell: XdgShell,

/// The currently present windows.
pub windows: RefCell<AHashMap<WindowId, Arc<Mutex<WindowState>>>>,
pub windows: RefCell<HashMap<WindowId, Arc<Mutex<WindowState>>>>,

/// The requests from the `Window` to EventLoop, such as close operations and redraw requests.
pub window_requests: RefCell<AHashMap<WindowId, Arc<WindowRequests>>>,
pub window_requests: RefCell<HashMap<WindowId, Arc<WindowRequests>>>,

/// The events that were generated directly from the window.
pub window_events_sink: Arc<Mutex<EventSink>>,
Expand All @@ -74,10 +74,10 @@ pub struct WinitState {
pub window_compositor_updates: Vec<WindowCompositorUpdate>,

/// Currently handled seats.
pub seats: AHashMap<ObjectId, WinitSeatState>,
pub seats: HashMap<ObjectId, WinitSeatState>,

/// Currently present cursor surfaces.
pub pointer_surfaces: AHashMap<ObjectId, Arc<ThemedPointer<WinitPointerData>>>,
pub pointer_surfaces: HashMap<ObjectId, Arc<ThemedPointer<WinitPointerData>>>,

/// The state of the text input on the client.
pub text_input_state: Option<TextInputState>,
Expand Down Expand Up @@ -156,7 +156,7 @@ impl WinitState {

let seat_state = SeatState::new(globals, queue_handle);

let mut seats = AHashMap::default();
let mut seats = HashMap::default();
for seat in seat_state.seats() {
seats.insert(seat.id(), WinitSeatState::new());
}
Expand Down
2 changes: 1 addition & 1 deletion winit-wayland/src/window/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use std::num::NonZeroU32;
use std::sync::{Arc, Mutex, Weak};
use std::time::Duration;

use ahash::HashSet;
use dpi::{LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize, Size};
use foldhash::HashSet;
use sctk::compositor::{CompositorState, Region, SurfaceData, SurfaceDataExt};
use sctk::globals::GlobalData;
use sctk::reexports::client::backend::ObjectId;
Expand Down
1 change: 1 addition & 0 deletions winit/src/changelog/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ changelog entry.

- On X11, fix `set_hittest` not working on some window managers.
- On Redox, handle `EINTR` when reading from `event_socket` instead of panicking.
- On Wayland, switch from using the `ahash` hashing algorithm to `foldhash`.