diff --git a/daemon/Cargo.toml b/daemon/Cargo.toml index e75e4f09..52d4099c 100644 --- a/daemon/Cargo.toml +++ b/daemon/Cargo.toml @@ -14,7 +14,7 @@ wayland-client = { version = "0.31", default-features = false, features = [ "log wayland-protocols = { version = "0.31", default-features = false, features = [ "client", "staging" ]} wayland-protocols-wlr = { version = "0.2", default-features = false, features = [ "client" ]} -rustix = { version = "0.38", default-features = false, features = [ "event", "shm", "mm", "net" ] } +rustix = { version = "0.38", default-features = false, features = [ "event" ] } libc = "0.2" keyframe = "1.1" diff --git a/daemon/src/main.rs b/daemon/src/main.rs index 9bff16ab..d4a52122 100644 --- a/daemon/src/main.rs +++ b/daemon/src/main.rs @@ -374,7 +374,7 @@ impl Daemon { Request::Clear(clear) => { let wallpapers = self.find_wallpapers_by_names(&clear.outputs); let color = clear.color; - match std::thread::Builder::new() + let spawn_result = std::thread::Builder::new() .stack_size(1 << 15) .name("clear".to_string()) .spawn(move || { @@ -386,7 +386,8 @@ impl Daemon { wallpaper.clear(color); wallpaper.draw(); } - }) { + }); + match spawn_result { Ok(_) => Answer::Ok, Err(e) => Answer::Err(format!("failed to spawn `clear` thread: {e}")), } @@ -415,7 +416,8 @@ impl Daemon { } used_wallpapers.push(wallpapers); } - self.animator.transition(transition, imgs, animations, used_wallpapers) + self.animator + .transition(transition, imgs, animations, used_wallpapers) } }; if let Err(e) = answer.send(&stream) { diff --git a/daemon/src/wallpaper.rs b/daemon/src/wallpaper.rs index fdfc09e6..0ac2e7c4 100644 --- a/daemon/src/wallpaper.rs +++ b/daemon/src/wallpaper.rs @@ -9,7 +9,7 @@ use std::{ num::NonZeroI32, sync::{ atomic::{AtomicBool, AtomicUsize, Ordering}, - Arc, Condvar, Mutex, RwLock, + Condvar, Mutex, RwLock, }, }; @@ -27,7 +27,6 @@ use crate::{bump_pool::BumpPool, Daemon, LayerSurface}; #[derive(Debug)] struct AnimationState { id: AtomicUsize, - transition_finished: Arc, } #[derive(Debug)] @@ -132,7 +131,6 @@ impl Wallpaper { inner_staging, animation_state: AnimationState { id: AtomicUsize::new(0), - transition_finished: Arc::new(AtomicBool::new(false)), }, configured: AtomicBool::new(false), qh: qh.clone(), @@ -381,9 +379,6 @@ impl Wallpaper { #[inline] pub(super) fn stop_animations(&self) { self.animation_state.id.fetch_add(1, Ordering::AcqRel); - self.animation_state - .transition_finished - .store(false, Ordering::Release); } pub(super) fn clear(&self, color: [u8; 3]) { diff --git a/utils/src/ipc.rs b/utils/src/ipc.rs index a68095dc..3ed40282 100644 --- a/utils/src/ipc.rs +++ b/utils/src/ipc.rs @@ -634,7 +634,10 @@ impl Request { { for i in 0..outputs.len() { let Img { - path, dim: dims, format, .. + path, + dim: dims, + format, + .. } = &imgs[i]; for output in outputs[i].iter() { if let Err(e) = super::cache::store(output, path) { @@ -1125,7 +1128,7 @@ fn create_memfd() -> rustix::io::Result { use rustix::fs::{MemfdFlags, SealFlags}; use std::ffi::CStr; - let name = CStr::from_bytes_with_nul(b"swww-daemon\0").unwrap(); + let name = CStr::from_bytes_with_nul(b"swww-ipc\0").unwrap(); let flags = MemfdFlags::ALLOW_SEALING | MemfdFlags::CLOEXEC; loop {