-
-
Notifications
You must be signed in to change notification settings - Fork 132
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 a window swap operation #899
base: main
Are you sure you want to change the base?
Conversation
Interesting, what do you use this for? |
I usually have a column of things I'm working on in the context of some project or other (say 3-5 windows), and to the side a column with a single window (or maybe 2). The work happens in the single "master" window, and I swap the windows into this "master" position based on what needs doing. What I like about this approach is that it keeps a set of windows available as a palette of sorts, while also affording |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also don't forget to run cargo +nightly fmt
.
src/layout/scrolling.rs
Outdated
); | ||
|
||
// special case when the source column disappears after removing its last tile | ||
let adjusted_target_column_idx = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make target_column_idx
mutable and -= 1
it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, but I still need the original target_column_idx
further along. The adjusted_target_column_idx
is only meaningful during the code window where the source column may have been removed and has not yet been recreated.
I added an explicit block to make this more obvious.
Swap the active window with the a neighboring column's active window.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebased and fixed two small issues. Could you address these two remaining ones?
Swap the active window with the a neighboring column's active window.
- Added a block around the relevant use of `adjusted_target_column_idx` in attempt to make the logic clearer - ran `cargo +nightly fmt` - Added a `SwapWindowInDirection` variant to the `Op` test enum
* Set is-active-in-column to true for unmapped windows * Update wiki/Configuration:-Window-Rules.md --------- Co-authored-by: Ivan Molodetskikh <[email protected]>
- no longer behave like an expel when a swap is made in a direction where there is no column to swap with - fix janky animation
Swap the active window in the active column with a neighboring column's active window.
This PR adds a
swap-window-left
andswap-window-right
action. They are used to swap the active windowin the active column with the active window in a neighboring column. When there is no neighboring column it
behaves just like the respective
expel-window-....
actions.This is something quite simple but that I often found missing when using Niri. It was standard in Awesome and easy enough to script in Sway, but I was unable to create a decent niri-ipc based version.