mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-05-06 10:53:23 +02:00
refactor(animation): rename animation mod to engine
Linter was upset about this: > error: module has the same name as its containing module
This commit is contained in:
@@ -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();
|
||||
@@ -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;
|
||||
|
||||
@@ -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()?;
|
||||
|
||||
@@ -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()?;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user