Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

When group focused, return to last focused window in that group

Open OctarineSourcerer opened this issue 2 years ago • 2 comments

I'd like for there to be an option to change which window gets selected when moving back to a previously focused group.

Take this example: FocusDemo

With current behaviour, starting at the big window and focusing right, down, left, right would select the top-right window. Having just come from bspwm and i3, this surprised me; I'd have expected it to have selected the bottom-right window, as that was the window on the right of the big one that was last focused.

As far as I can tell, I can't see a way of setting this in the docs. I'd perhaps call it focus_prefer_recent or something?

OctarineSourcerer avatar Nov 13 '22 21:11 OctarineSourcerer

yeah the current system.... I don't even remember how it works but iirc prefers the oldest window in case of equal shared border. I agree with the suggestion tho.

One question this poses is: should the system prefer last over longer shared border?

example is your exact situation, but assume the bottom-right window is very small.

When doing right from the big one, should it prefer the "last" status over the size of the top window?

vaxerski avatar Nov 14 '22 01:11 vaxerski

should the system prefer last over longer shared border?

I think so: last indicates what the user most recently used, so is more likely to be the intended target when going back again.

If that'd cause divides between opinions, we could always do an option such as preferred_focus_window with options like recent, biggest_shared or oldest

OctarineSourcerer avatar Nov 14 '22 09:11 OctarineSourcerer

added in 94b7b6b58475a0e802e390591f95e04c70aa676d

binds:focus_preferred_method can be either 0 for history (default) or 1 for longest edge

vaxerski avatar Jan 26 '23 14:01 vaxerski