Add swap window actions
This adds window actions that allow swapping the current window's position and size with the window to the left, top, right, or bottom. You can configure keyboard shortcuts to activate these actions.
The actions are named SwapL, SwapT, SwapR, and SwapB for left, top, right, and bottom, respectively.
Nice addition, thanks for taking the time to develop it.
After using it for a while, I found it occasionally confusing. To improve clarity, I added a simple animation to make it easier to see what is happening. The animation can be controlled through two new configuration values in the advanced section (not exposed via the UI, as it's probably not worth the effort):
SwapAnimationSteps=10
; Specifies the number of animation steps when swapping windows (SwapL, SwapR,
; SwapT, SwapB). Set to 0 to disable the swap animation entirely.
SwapAnimationDelay=5
; Specifies the delay (in milliseconds) between each step of the swap animation.
Sorry for another change to this. After using this feature on an older notebook, I realized how poor the performance can be when animating window resizing during swapping. I added an option to disable the resizing part of the animation (disabled by default). This results in a much smoother experience.
The updated settings are (acvanced section):
SwapAnimationSteps=10
; Specifies the number of animation steps when swapping windows (SwapL, SwapR,
; SwapT, SwapB). Set to 0 to disable the swap animation entirely.
SwapAnimationDelay=5
; Specifies the delay (in milliseconds) between each step of the swap animation.
SwapAnimateResize=0
; Specifies whether window resizing should be animated during window swapping.
; Note that, depending on the hardware and the application being swapped,
; this can result in poor performance. Set to 1 to enable, 0 to disable.
Just a detail, I do not like much to use floating points for this kind of calculations. In the whole project there is zero floating point, I do not trust the arithmetic will always be pixel prefect. and I do not like to rely on fpu in general when not needed.
Could you modify your code so that it no longer relies on fpu?
Otherwise I can do it myself, no problems