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

master: make loop around optional when cycling #8926

Merged
merged 1 commit into from
Jan 4, 2025

Conversation

lonyelon
Copy link
Contributor

@lonyelon lonyelon commented Jan 1, 2025

Describe your PR, what does it fix/add?

Implement the option to not loop around when cycling windows in the master layout (i.e. going from master to the last slave or vice-versa), replicating this layout's behavior in DWL.

No default behavior was modified, and the option noLoopAround option was added to cyclenext, cycleprev, swapnext and swapprev. This ensures no current setups are broken.

Example usage:

  • Default, can cycle around as always:
    bind = $mainMod, up,    layoutmsg, cycleprev
    bind = $mainMod, down,  layoutmsg, cyclenext
  • Same as default but with explicit option set:
    bind = $mainMod, up,    layoutmsg, cycleprev loop
    bind = $mainMod, down,  layoutmsg, cyclenext loop
  • No looping around (as in DWM):
    bind = $mainMod, up,    layoutmsg, cycleprev noloop
    bind = $mainMod, down,  layoutmsg, cyclenext noloop

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

I think it is, I tested it and it works, but I am new in this codebase so some important test may be missing.

@lonyelon lonyelon force-pushed the optional-cycling-test branch from 5f93dfe to f716ee0 Compare January 2, 2025 10:18
@lonyelon
Copy link
Contributor Author

lonyelon commented Jan 2, 2025

Hello vaxry,

Would it be better to add a new layout command named cyclenextnoloop rather than making this a param for cyclenext? It would be like movetoworkspace and movetoworkspacesilent.

@lonyelon lonyelon requested a review from vaxerski January 2, 2025 10:21
@lonyelon lonyelon force-pushed the optional-cycling-test branch from f716ee0 to 2c2bb81 Compare January 2, 2025 11:33
@vaxerski
Copy link
Member

vaxerski commented Jan 2, 2025

no, param is better imo

@lonyelon
Copy link
Contributor Author

lonyelon commented Jan 3, 2025

Ok so we can leave it like this.

vaxerski
vaxerski previously approved these changes Jan 3, 2025
Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep this lgtm, just a wiki mr needed

@lonyelon
Copy link
Contributor Author

lonyelon commented Jan 3, 2025

Added in hyprwm/hyprland-wiki#926!

@lonyelon
Copy link
Contributor Author

lonyelon commented Jan 4, 2025

clang style issues fixed.

Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@vaxerski vaxerski merged commit b0bae15 into hyprwm:main Jan 4, 2025
11 checks passed
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.

2 participants