Skip to content
Draft
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
199 changes: 107 additions & 92 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ which = "8"
version = "0.62"
features = [
"Foundation_Numerics",
"Graphics_Capture",
"Graphics_DirectX_Direct3D11",
"Win32_Devices",
"Win32_Devices_Display",
"Win32_System_Com",
Expand All @@ -61,6 +63,12 @@ features = [
"Win32_Graphics_Direct2D",
"Win32_Graphics_Direct2D_Common",
"Win32_Graphics_Dxgi_Common",
"Win32_Graphics_Dxgi",
"Win32_Graphics_Direct3D",
"Win32_Graphics_Direct3D11",
"Win32_System_WinRT_Direct3D11",
"Win32_System_WinRT_Graphics_Capture",
"Win32_Graphics_DirectComposition",
"Win32_System_LibraryLoader",
"Win32_System_Power",
"Win32_System_RemoteDesktop",
Expand Down
2 changes: 2 additions & 0 deletions komorebi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ windows-interface = { workspace = true }
winput = "0.2"
winreg = "0.55"
serde_with = { version = "3.12", features = ["schemars_1"] }
windows-capture = "2.0.0-alpha.7"
windows-future = "0.3.2"

[build-dependencies]
shadow-rs = { workspace = true }
Expand Down
3 changes: 2 additions & 1 deletion komorebi/src/animation/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl AnimationEngine {

#[allow(clippy::cast_precision_loss)]
pub fn animate(
render_dispatcher: impl RenderDispatcher + Send + 'static,
mut render_dispatcher: impl RenderDispatcher + Send + 'static,
duration: Duration,
) -> eyre::Result<()> {
std::thread::spawn(move || {
Expand Down Expand Up @@ -84,6 +84,7 @@ impl AnimationEngine {
.lock()
.is_cancelled(animation_key.as_str())
{
render_dispatcher.on_cancle();
// cancel animation
ANIMATION_MANAGER.lock().cancel(animation_key.as_str());
return Ok(());
Expand Down
1 change: 1 addition & 0 deletions komorebi/src/animation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub mod prefix;
pub mod render_dispatcher;
pub use render_dispatcher::RenderDispatcher;
pub mod style;
pub mod workspace_switch;

use serde::Deserialize;
use serde::Serialize;
Expand Down
1 change: 1 addition & 0 deletions komorebi/src/animation/prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use strum::EnumString;
pub enum AnimationPrefix {
Movement,
Transparency,
WrokspaceSwitch,
}

pub fn new_animation_key(prefix: AnimationPrefix, key: String) -> String {
Expand Down
7 changes: 4 additions & 3 deletions komorebi/src/animation/render_dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ use color_eyre::eyre;

pub trait RenderDispatcher {
fn get_animation_key(&self) -> String;
fn pre_render(&self) -> eyre::Result<()>;
fn render(&self, delta: f64) -> eyre::Result<()>;
fn post_render(&self) -> eyre::Result<()>;
fn pre_render(&mut self) -> eyre::Result<()>;
fn render(&mut self, delta: f64) -> eyre::Result<()>;
fn post_render(&mut self) -> eyre::Result<()>;
fn on_cancle(&mut self);
}
Loading
Loading