Hyprland
Hyprland copied to clipboard
Add an option to disable wrapping for movefocus
There's a focus_wrapping
option in sway config.
- The default option is
focus_wrapping=yes
, which behaves the same as Hyprland. - Set
focus_wrapping=no
will disable move to left when current focused window is already the most left window. Likewise for other directions.
Here's the doc for this option in man 5 sway
.
focus_wrapping yes|no|force|workspace This option determines what to do when attempting to focus over the edge of a container. If set to no, the focused container will retain focus, if there are no other containers in the direction. If set to yes, focus will be wrapped to the opposite edge of the container, if there are no other containers in the direction. If set to force, focus will be wrapped to the opposite edge of the container, even if there are other containers in the direction. If set to workspace, focus will wrap like in the yes case and additionally wrap when moving outside of workspaces boundaries. Default is yes.
Hope for a similar config option for Hyprland.
I also found that movewindow
does not wrap in Hyprland. It would be more consistent to have same behavior for both movewindow
and movefocus
After digging into src/managers/KeybindManager.cpp
, it seems weird to move focus to getNextWindowOnWorkspace
if no getWindowInDirection
matched.
https://github.com/hyprwm/Hyprland/blob/3d1b255199db3ce9539befcd8547331b312a34e7/src/managers/KeybindManager.cpp#L1084
getNextWindowOnWorkspace
sort windows by ID. And those IDs seems not to be changed if windows are moved around. Resulting in messing focus movements if no window matches in target direction and windows are already moved around.
Also, The behavior here has nothing to do with focus_wrapping
. Maybe its better to just remove the alternative getNextWindowOnWorkspace
movement besides getWindowInDirection
.
is this implemented with no_focus_fallback
?
is this implemented with
no_focus_fallback
?
@MightyPlaza
Not yet. movefocus
still wraps.
wdym?
works for me or I am misunderstanding
the only thing missing is a var to enable movewindow
fallback
@MightyPlaza How sway behaves follows. And it's what I mean here.
wrapping (|x|
means focused window, ->
means movefocus
right once)
| |x| | -> | | |x| -> |x| | |
no wrapping (do not movefocus again if already focusing the last window)
| |x| | -> | | |x| -> | | |x|
Similar rules should apply to movewindow
.
@MightyPlaza My bad. Typos. I retried no_focus_fallback
, and it's working now. This issue can be closed.