Skip to content
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

Add swap window actions #558

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

gizabit
Copy link
Contributor

@gizabit gizabit commented Oct 5, 2024

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.

@RamonUnch
Copy link
Owner

Nice addition, thanks for taking the time to develop it.

@gizabit
Copy link
Contributor Author

gizabit commented Oct 7, 2024

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.

@gizabit
Copy link
Contributor Author

gizabit commented Oct 16, 2024

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.

@RamonUnch
Copy link
Owner

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?

@RamonUnch
Copy link
Owner

Otherwise I can do it myself, no problems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants