From e502cb3ffb8cee3fbc4ddeca6311b6016abc49d9 Mon Sep 17 00:00:00 2001 From: thearturca Date: Sun, 10 Nov 2024 12:03:25 +0300 Subject: [PATCH] refactor(animation): rename `animation` mod to `engine` Linter was upset about this: > error: module has the same name as its containing module --- komorebi/src/animation/{animation.rs => engine.rs} | 4 ++-- komorebi/src/animation/mod.rs | 4 ++-- komorebi/src/main.rs | 4 ++-- komorebi/src/process_command.rs | 4 ++-- komorebi/src/window.rs | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) rename komorebi/src/animation/{animation.rs => engine.rs} (98%) diff --git a/komorebi/src/animation/animation.rs b/komorebi/src/animation/engine.rs similarity index 98% rename from komorebi/src/animation/animation.rs rename to komorebi/src/animation/engine.rs index 855bb65c..0104c891 100644 --- a/komorebi/src/animation/animation.rs +++ b/komorebi/src/animation/engine.rs @@ -14,9 +14,9 @@ use super::ANIMATION_FPS; use super::ANIMATION_MANAGER; #[derive(Debug, Default, Clone, Copy, Serialize, Deserialize, JsonSchema, PartialEq)] -pub struct Animation; +pub struct AnimationEngine; -impl Animation { +impl AnimationEngine { pub fn wait_for_all_animations() { let max_duration = Duration::from_secs(20); let spent_duration = Instant::now(); diff --git a/komorebi/src/animation/mod.rs b/komorebi/src/animation/mod.rs index cd5ef3bb..3fe6f0c2 100644 --- a/komorebi/src/animation/mod.rs +++ b/komorebi/src/animation/mod.rs @@ -8,9 +8,9 @@ use std::sync::Arc; use parking_lot::Mutex; -pub mod animation; -pub use animation::Animation; +pub use engine::AnimationEngine; pub mod animation_manager; +pub mod engine; pub mod lerp; pub mod prefix; pub mod render_dispatcher; diff --git a/komorebi/src/main.rs b/komorebi/src/main.rs index e6cfbb99..1507c683 100644 --- a/komorebi/src/main.rs +++ b/komorebi/src/main.rs @@ -17,7 +17,7 @@ use std::time::Duration; use clap::Parser; use color_eyre::Result; use crossbeam_utils::Backoff; -use komorebi::animation::Animation; +use komorebi::animation::AnimationEngine; use komorebi::animation::ANIMATION_ENABLED; #[cfg(feature = "deadlock_detection")] use parking_lot::deadlock; @@ -291,7 +291,7 @@ fn main() -> Result<()> { ANIMATION_ENABLED.store(false, Ordering::SeqCst); wm.lock().restore_all_windows()?; - Animation::wait_for_all_animations(); + AnimationEngine::wait_for_all_animations(); if WindowsApi::focus_follows_mouse()? { WindowsApi::disable_focus_follows_mouse()?; diff --git a/komorebi/src/process_command.rs b/komorebi/src/process_command.rs index 35822c1a..1a302feb 100644 --- a/komorebi/src/process_command.rs +++ b/komorebi/src/process_command.rs @@ -22,7 +22,7 @@ use schemars::gen::SchemaSettings; use schemars::schema_for; use uds_windows::UnixStream; -use crate::animation::Animation; +use crate::animation::AnimationEngine; use crate::core::config_generation::ApplicationConfiguration; use crate::core::config_generation::IdWithIdentifier; use crate::core::config_generation::MatchingRule; @@ -880,7 +880,7 @@ impl WindowManager { ANIMATION_ENABLED.store(false, Ordering::SeqCst); self.restore_all_windows()?; - Animation::wait_for_all_animations(); + AnimationEngine::wait_for_all_animations(); if WindowsApi::focus_follows_mouse()? { WindowsApi::disable_focus_follows_mouse()?; diff --git a/komorebi/src/window.rs b/komorebi/src/window.rs index d0a995dc..ccf80763 100644 --- a/komorebi/src/window.rs +++ b/komorebi/src/window.rs @@ -1,6 +1,7 @@ use crate::animation::lerp::Lerp; use crate::animation::prefix::new_animation_key; use crate::animation::prefix::AnimationPrefix; +use crate::animation::AnimationEngine; use crate::animation::RenderDispatcher; use crate::animation::ANIMATION_DURATION; use crate::animation::ANIMATION_ENABLED; @@ -41,7 +42,6 @@ use crate::core::ApplicationIdentifier; use crate::core::HidingBehaviour; use crate::core::Rect; -use crate::animation::animation::Animation; use crate::styles::ExtendedWindowStyle; use crate::styles::WindowStyle; use crate::transparency_manager; @@ -353,7 +353,7 @@ impl Window { let render_dispatcher = WindowMoveRenderDispatcher::new(self.hwnd, window_rect, *layout, top, style); - Animation::animate(render_dispatcher, duration) + AnimationEngine::animate(render_dispatcher, duration) } else { WindowsApi::position_window(self.hwnd, layout, top) } @@ -474,7 +474,7 @@ impl Window { style, ); - Animation::animate(render_dispatcher, duration) + AnimationEngine::animate(render_dispatcher, duration) } else { let mut ex_style = self.ex_style()?; ex_style.insert(ExtendedWindowStyle::LAYERED); @@ -500,7 +500,7 @@ impl Window { style, ); - Animation::animate(render_dispatcher, duration) + AnimationEngine::animate(render_dispatcher, duration) } else { let mut ex_style = self.ex_style()?; ex_style.remove(ExtendedWindowStyle::LAYERED);