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

Modified the movefocus dispatcher to prioritize focus change within groups. #8601

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

Conversation

normaltaro
Copy link
Contributor

@normaltaro normaltaro commented Nov 28, 2024

Describe your PR, what does it fix/add?

It modifies the movefocus dispatcher logic to switch directional focus within groups first:

  • Check if the current window is part of a Group.
  • movefocus l/r can now be used to switch tabs within the Group
  • If the current window is the first/last tab of its group OR movefocus u/d is pressed, then the usual directional focus logic applies.

In other words, a sideways directional focus change is prioritized within groups first.

How I think it benefits users?
  • Better defaults
    • I think most users (like me) expect the directional flow of movefocus dispatcher to be followed within groups as it does in other window managers. I felt locked out of tabbed groups and never really used them because of this.
    • It is not possible to do so using changegroupactive along with movefocus as they require separate keybinds which do not conflict.
    • This keeps the last active index intact when focus is moved out of the group.
    • Personally, I think the overall experience with this patch is much better compared to other window managers regarding tabbed groups (like i3)
  • Example:
    • mod h/j/k/l with movefocus l/r/u/d is intuitive for groups too.

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

I haven't found any bugs. It works as per the logic described above.

Is it ready for merging, or does it need work?

I have tried with all kinds of group orientations and it works good. It is a single block of 13 lines and could be merged as-is. :)

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

Successfully merging this pull request may close these issues.

1 participant