From 76fc1bfab553dae46ee18547581f3d4564536292 Mon Sep 17 00:00:00 2001 From: Nova Date: Sun, 21 Sep 2025 00:39:55 -0700 Subject: [PATCH] cleanup: thingys --- Cargo.toml | 10 ++-------- src/core/registry.rs | 16 ++++++++-------- src/nodes/input/mod.rs | 8 ++++---- src/objects/input/mod.rs | 9 ++++----- src/wayland/xdg/popup.rs | 2 +- 5 files changed, 19 insertions(+), 26 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 91b4968..dc5c7c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,7 +73,7 @@ bevy_core_pipeline = { git = "https://github.com/Schmarni-Dev/bevy", branch = "p # small utility thingys nanoid = "0.4.0" lazy_static = "1.5.0" -rand = "0.8.5" +rand = "0.9.2" rustc-hash = "2.0.0" slotmap = "1.0.7" global_counter = "=0.2.2" @@ -145,13 +145,7 @@ xkbcommon-rs = "0.1.0" cosmic-text = "0.14.2" # Wayland -# waynest = { git = "https://github.com/verdiwm/waynest.git", branch="codec-test", features = [ -# "server", -# "stable", -# "mesa", -# "tracing", -# ], default-features = false, optional = true } -waynest = { git = "https://github.com/technobaboo/waynest.git", branch = "fix/fd_clear", features = [ +waynest = { git = "https://github.com/verdiwm/waynest.git", branch="codec-test", features = [ "server", "stable", "mesa", diff --git a/src/core/registry.rs b/src/core/registry.rs index 360bfec..9e1092f 100644 --- a/src/core/registry.rs +++ b/src/core/registry.rs @@ -36,18 +36,18 @@ impl Registry { for pair in new.0.iter() { let (id, entry) = pair.pair(); - if let Some(entry) = entry.upgrade() { - if !old.0.contains_key(id) { - added.push(entry); - } + if let Some(entry) = entry.upgrade() + && !old.0.contains_key(id) + { + added.push(entry); } } for pair in old.0.iter() { let (id, entry) = pair.pair(); - if let Some(entry) = entry.upgrade() { - if !new.0.contains_key(id) { - removed.push(entry); - } + if let Some(entry) = entry.upgrade() + && !new.0.contains_key(id) + { + removed.push(entry); } } (added, removed) diff --git a/src/nodes/input/mod.rs b/src/nodes/input/mod.rs index 9db6187..3111049 100644 --- a/src/nodes/input/mod.rs +++ b/src/nodes/input/mod.rs @@ -138,10 +138,10 @@ pub fn process_input() { if !handler_node.enabled() { continue; } - if let Some(handler_field_node) = handler.field.spatial.node() { - if !handler_field_node.enabled() { - continue; - } + if let Some(handler_field_node) = handler.field.spatial.node() + && !handler_field_node.enabled() + { + continue; }; let ser_span = debug_span!("serializing input").entered(); diff --git a/src/objects/input/mod.rs b/src/objects/input/mod.rs index d481506..6dcba58 100644 --- a/src/objects/input/mod.rs +++ b/src/objects/input/mod.rs @@ -20,14 +20,13 @@ pub struct CaptureManager { } impl CaptureManager { pub fn update_capture(&mut self, method: &InputMethod) { - if let Some(capture) = &self.capture.upgrade() { - if !method + if let Some(capture) = &self.capture.upgrade() + && !method .capture_attempts .get_valid_contents() .contains(capture) - { - self.capture = Weak::new(); - } + { + self.capture = Weak::new(); } } pub fn set_new_capture( diff --git a/src/wayland/xdg/popup.rs b/src/wayland/xdg/popup.rs index 268aaaa..29473a3 100644 --- a/src/wayland/xdg/popup.rs +++ b/src/wayland/xdg/popup.rs @@ -22,7 +22,7 @@ impl Popup { let _ = surface .wl_surface .surface_id - .set(SurfaceId::Child(rand::thread_rng().gen_range(0..u64::MAX))); + .set(SurfaceId::Child(rand::rng().random())); let positioner_data = positioner.data(); Self {