Shift Focus Window feature #412
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While
focus-window-nextand -prev cycle through windows by-keyboard, this adds two customizable additional configurable shortcuts that will switch the focus window's position/size with the next window. This allows, with a single keyboard-chord to e.g. swap a bigger window area with a smaller window area and then back and forth to manage which one has more attention.Besides adding the slots/api-calls, this moves some of the logic that was used in
_onKeyboardFocusWinto an abstracted function that can also be used for the swap/shift events. Most of that method avoids behavior changes, however one part does not out of necessity --workspace.list_windows()does not have a stable ordering, so we sort here roughly by-clockface -- so people's experience may shift subtly forfocus-window-next-- however, I would argue that this is mostly a 'feature-not-a-bug' as the window ordering becomes a bit more intuitive (if not immediately, then when you get used to it)Some added context: I'm an XMonad refugee and interested in adding some of the features/behavior that XMonad offered -- instead of a 'directional' shifting/movement, it 'cycled' through window positions a bit more. This is my first contribution. Eventually I'd also like to add some keyboard shortcuts for resizing the focus window by-keyboard, though it looked like with the upcoming layout changes, I didn't want to add complexity/conflicts with upcoming changes (without feedback).