-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(animations): add window move animations #597
Conversation
482a8b8
to
5651986
Compare
@LGUG2Z Hi there. I was watching your videos and came up with idea to animate border too. The idea is to shrink border in size to be smaller than current focused window and then raise it up in new focused window position. So we have 2 part of transition - out and in. I did some progress on that but get stuck on several issue. Border demo (WIP)border-animation.mp4Issues
// window rect
[komorebi\src\border.rs:197] window_rect = Rect {
left: 961,
top: 58,
right: 948,
bottom: 501,
}
// current border rect. Before transition
[komorebi\src\border.rs:198] prev_border_rect = Rect {
left: 14,
top: 54,
right: 942,
bottom: 1012,
}
// calculating center point in current focused window
[komorebi\src\border.rs:199] out_new_center_point_top = 479
[komorebi\src\border.rs:200] out_new_center_point_left = 464
// calculated rect for first part of transition. It should be smaller than current window rect by 50%
[komorebi\src\border.rs:201] out_new_rect = Rect {
left: 239,
top: 266,
right: 703,
bottom: 745,
}
// calculating center point in new focused window
[komorebi\src\border.rs:202] in_start_center_point_top = 224
[komorebi\src\border.rs:203] in_start_center_point_left = -11
// calculated rect for second part of transition. It should be smaller than target rect by 50%
[komorebi\src\border.rs:204] in_start_rect = Rect {
left: 477,
top: 139,
right: 465,
bottom: 363,
}
// target border rect. After transition
[komorebi\src\border.rs:205] rect = Rect {
left: 964,
top: 54,
right: 942,
bottom: 502,
}
I dont know should I dig further or give up with that idea because it's produces more bugs and issue? 馃樅 |
This is a pretty old piece of code and I don't quite remember at this point 馃槄 However, if you remove the transactions the border goes absolutely way too wide to the right and to the bottom lol. I think the doubled events relates to the Which then triggers another Maybe we can add another WindowManagerEvent to be called in the first instance, which would trigger the handler for this in the |
Can you try making this change in // self.focused_window_mut()?.focus(self.mouse_follows_focus)?;
WINEVENT_CALLBACK_CHANNEL
.lock()
.0
.send(WindowManagerEvent::UpdateFocusedWindowBorder(
*self.focused_window()?,
))?; |
https://github.com/LGUG2Z/komorebi/blob/master/komorebi/src/window_manager.rs#L1329 I think you can also try removing this line for moves, which is the culprit for the |
@thearturca I've been noticing quite a lot of issues with the ALT key "sticking" (for lack of a better term) when using this branch; have you experienced this at all? |
@LGUG2Z You've missed komorebic commands. Its still |
I've tried that but it didnt help. Still getting 3 calls of I have some news about first issue that mentioned here. From in Rect struct is converting |
c57f79b
to
a012262
Compare
Commit to pull changes from master
At current state animation is working. Configs are available for it. animation enable/disable animation-duration {duration in ms} animation-ease -e {ease func. See --help} Two major problems for my implementation: 1. Google Chrome window is broken and I don't know how to implement fix for it. 2. Border window does not update properly with window. Dont know how to fix it.
This commit fixes an issue where the active window border would not properly update when animations were enabled. Various clippy lints have also been addressed, but I still need to look into the infinite loop lint that has been marked with a todo comment.
This commit ensures that the UpdateFocusedWindowBorder WindowManagerEvent which is handled in process_event is used to position the mouse correctly on the moved window once the animation has been completed. A pending clippy lint in animation.rs has also been addressed.
a012262
to
23cc38b
Compare
With all of the latest changes from What do you think about getting this work merged and then opening a separate PR for border animations? |
@LGUG2Z chrome_bug.mp4Its occurs when komorebi perform two animation in different direction. Maybe we should add some WIN32 flag to position method idk. |
If you are moving two+ windows simultaneously, you could look into using DeferWindowPos which should be faster/smoother |
6a03849
to
f519cba
Compare
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21.
Continuing this in #685 - rebasing with all of the commits was a nightmare so I just took the changes onto a new branch with a single commit so I only had to resolve conflicts once. |
This commit contains all the changes of LGUG2Z#597 to make it easier to rebase with the latest changes on master post-v0.1.21.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21. fix(animation): Fixed cancelling logic (57e9b2f) Added static animation state manager for tracking "in_progress" and "is_cancelled" states. The idea is not to have states in Animation struct but to keep them in HashMap<hwnd, AnimationState> behind reference (Arc<Mutex<>>). So we each animation frame we have access to state and can cancel animation if we have to. Need review and testings refactor(animation): avoid unwrap (fa6d5bb)
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21. fix(animation): Fixed cancelling logic (57e9b2f) Added static animation state manager for tracking "in_progress" and "is_cancelled" states. The idea is not to have states in Animation struct but to keep them in HashMap<hwnd, AnimationState> behind reference (Arc<Mutex<>>). So we each animation frame we have access to state and can cancel animation if we have to. Need review and testings refactor(animation): avoid unwrap (fa6d5bb) fix(animation): Move cancel call to Animation struct (306513f) Only focused window was cancelling its animation because we call cancel in window::set_position and waiting for its cancelling. And because we waiting for cancelling second window is still moving. Second window will stop moving only after the first window. So I moved `cancel` call to Animation struct so its happening in its own thread and doesn't block others animation moves and cancels.
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21. fix(animation): Fixed cancelling logic (57e9b2f) Added static animation state manager for tracking "in_progress" and "is_cancelled" states. The idea is not to have states in Animation struct but to keep them in HashMap<hwnd, AnimationState> behind reference (Arc<Mutex<>>). So we each animation frame we have access to state and can cancel animation if we have to. Need review and testings refactor(animation): avoid unwrap (fa6d5bb) fix(animation): Move cancel call to Animation struct (306513f) Only focused window was cancelling its animation because we call cancel in window::set_position and waiting for its cancelling. And because we waiting for cancelling second window is still moving. Second window will stop moving only after the first window. So I moved `cancel` call to Animation struct so its happening in its own thread and doesn't block others animation moves and cancels.
This commit contains all the changes of LGUG2Z#597 to make it easier to rebase with the latest changes on master post-v0.1.21. fix(animation): Fixed cancelling logic (57e9b2f) Added static animation state manager for tracking "in_progress" and "is_cancelled" states. The idea is not to have states in Animation struct but to keep them in HashMap<hwnd, AnimationState> behind reference (Arc<Mutex<>>). So we each animation frame we have access to state and can cancel animation if we have to. Need review and testings refactor(animation): avoid unwrap (fa6d5bb) fix(animation): Move cancel call to Animation struct (306513f) Only focused window was cancelling its animation because we call cancel in window::set_position and waiting for its cancelling. And because we waiting for cancelling second window is still moving. Second window will stop moving only after the first window. So I moved `cancel` call to Animation struct so its happening in its own thread and doesn't block others animation moves and cancels.
No description provided.