-
-
Notifications
You must be signed in to change notification settings - Fork 206
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’ll 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 #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.
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 #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 #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 #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 #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 #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. refactor(animation): renamed args parameters and variables names (8abb4b9) refactor(animation): inverse if-statement in `window::animate_position` (3de2c6e) There is was a bug when ease function generates `t` greater the `SetWindowPos` function will be called instead of `move_window`. `SetWindowPos` is only for last frame of animation. fix(wm): add shadow rect to `move_window` calls (b58620f) This fixes a bug when windows get shunk during the animation
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. refactor(animation): renamed args parameters and variables names (8abb4b9) refactor(animation): inverse if-statement in `window::animate_position` (3de2c6e) There is was a bug when ease function generates `t` greater the `SetWindowPos` function will be called instead of `move_window`. `SetWindowPos` is only for last frame of animation. fix(wm): add shadow rect to `move_window` calls (b58620f) This fixes a bug when windows get shunk during the animation
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. refactor(animation): renamed args parameters and variables names (8abb4b9) refactor(animation): inverse if-statement in `window::animate_position` (3de2c6e) There is was a bug when ease function generates `t` greater the `SetWindowPos` function will be called instead of `move_window`. `SetWindowPos` is only for last frame of animation. fix(wm): add shadow rect to `move_window` calls (b58620f) This fixes a bug when windows get shunk during the animation
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. refactor(animation): renamed args parameters and variables names (8abb4b9) refactor(animation): inverse if-statement in `window::animate_position` (3de2c6e) There is was a bug when ease function generates `t` greater the `SetWindowPos` function will be called instead of `move_window`. `SetWindowPos` is only for last frame of animation. fix(wm): add shadow rect to `move_window` calls (b58620f) This fixes a bug when windows get shunk during the animation
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. refactor(animation): renamed args parameters and variables names (8abb4b9) refactor(animation): inverse if-statement in `window::animate_position` (3de2c6e) There is was a bug when ease function generates `t` greater the `SetWindowPos` function will be called instead of `move_window`. `SetWindowPos` is only for last frame of animation. fix(wm): add shadow rect to `move_window` calls (b58620f) This fixes a bug when windows get shunk during the animation
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. refactor(animation): renamed args parameters and variables names (8abb4b9) refactor(animation): inverse if-statement in `window::animate_position` (3de2c6e) There is was a bug when ease function generates `t` greater the `SetWindowPos` function will be called instead of `move_window`. `SetWindowPos` is only for last frame of animation. fix(wm): add shadow rect to `move_window` calls (b58620f) This fixes a bug when windows get shunk during the animation
Work on this feature was first started by @thearturca in November 2023 before komorebi v0.1.21 in #597 and has undergone numerous revisions to reach the point of this commit. Although this is a single squashed commit, almost all of the heavy lifting for this feature was done by @thearturca, which is where all of the kudos and gratitude should be directed. This commit adds a new static configuration block for animations, where they can be enabled, and have their style, fps and duration set. Corresponding SocketMessages and komorebic cli commands have also been exposed. There are some caveats to the use of this feature, which revolve around the quality of the Windows compositor (it is not very good): * There will be visual artifacts with various apps when animations are taking place - komorebi can't do anything about this as it is a limitation of the Windows compositor * Since komorebi's borders are implemented as independent windows are are not a part of the windows they are drawn around, these borders will be hidden while animations are in progress * If you wish to use borders with this feature, you'll probably better off using BorderImplementation::Windows, which uses the native thin "accent" borders, which are part of the windows they are drawn around, and can be moved with those windows during animations As a result of these and other caveats, this feature will be marked as "experimental" for the foreseeable future and will be off-by-default. Below, a number of now-squashed commits that contributed to the stabilization of this feature are referenced to help with code archeology in the future. 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. refactor(animation): renamed args parameters and variables names (8abb4b9) refactor(animation): inverse if-statement in `window::animate_position` (3de2c6e) There is was a bug when ease function generates `t` greater the `SetWindowPos` function will be called instead of `move_window`. `SetWindowPos` is only for last frame of animation. fix(wm): add shadow rect to `move_window` calls (b58620f) This fixes a bug when windows get shunk during the animation
Work on this feature was first started by @thearturca in November 2023 before komorebi v0.1.21 in #597 and has undergone numerous revisions to reach the point of this commit. Although this is a single squashed commit, almost all of the heavy lifting for this feature was done by @thearturca, which is where all of the kudos and gratitude should be directed. This commit adds a new static configuration block for animations, where they can be enabled, and have their style, fps and duration set. Corresponding SocketMessages and komorebic cli commands have also been exposed. There are some caveats to the use of this feature, which revolve around the quality of the Windows compositor (it is not very good): * There will be visual artifacts with various apps when animations are taking place - komorebi can't do anything about this as it is a limitation of the Windows compositor * Since komorebi's borders are implemented as independent windows are are not a part of the windows they are drawn around, these borders will be hidden while animations are in progress * If you wish to use borders with this feature, you'll probably better off using BorderImplementation::Windows, which uses the native thin "accent" borders, which are part of the windows they are drawn around, and can be moved with those windows during animations As a result of these and other caveats, this feature will be marked as "experimental" for the foreseeable future and will be off-by-default. Below, a number of now-squashed commits that contributed to the stabilization of this feature are referenced to help with code archeology in the future. 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. refactor(animation): renamed args parameters and variables names (8abb4b9) refactor(animation): inverse if-statement in `window::animate_position` (3de2c6e) There is was a bug when ease function generates `t` greater the `SetWindowPos` function will be called instead of `move_window`. `SetWindowPos` is only for last frame of animation. fix(wm): add shadow rect to `move_window` calls (b58620f) This fixes a bug when windows get shunk during the animation
Work on this feature was first started by @thearturca in November 2023 before komorebi v0.1.21 in #597 and has undergone numerous revisions to reach the point of this commit. Although this is a single squashed commit, almost all of the heavy lifting for this feature was done by @thearturca, which is where all of the kudos and gratitude should be directed. This commit adds a new static configuration block for animations, where they can be enabled, and have their style, fps and duration set. Corresponding SocketMessages and komorebic cli commands have also been exposed. There are some caveats to the use of this feature, which revolve around the quality of the Windows compositor (it is not very good): * There will be visual artifacts with various apps when animations are taking place - komorebi can't do anything about this as it is a limitation of the Windows compositor * Since komorebi's borders are implemented as independent windows are are not a part of the windows they are drawn around, these borders will be hidden while animations are in progress * If you wish to use borders with this feature, you'll probably better off using BorderImplementation::Windows, which uses the native thin "accent" borders, which are part of the windows they are drawn around, and can be moved with those windows during animations As a result of these and other caveats, this feature will be marked as "experimental" for the foreseeable future and will be off-by-default. Below, a number of now-squashed commits that contributed to the stabilization of this feature are referenced to help with code archeology in the future. 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. refactor(animation): renamed args parameters and variables names (8abb4b9) refactor(animation): inverse if-statement in `window::animate_position` (3de2c6e) There is was a bug when ease function generates `t` greater the `SetWindowPos` function will be called instead of `move_window`. `SetWindowPos` is only for last frame of animation. fix(wm): add shadow rect to `move_window` calls (b58620f) This fixes a bug when windows get shunk during the animation
No description provided.