feat(switcher): add MRU order option - #4168
Open
SirMonteiro wants to merge 2 commits into
Open
Conversation
|
much appreciated! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Added Most Recently Used (MRU) window sorting support to
WindowSwitcherwhenshell.windowSwitcher.mruis enabled.Motivation
Previously,
WindowSwitchersorted windows strictly by workspace position, layout coordinates, and window title. When working across multiple windows or workspaces, users commonly expect standard MRU behavior where pressing Alt+Tab quickly alternates between the current and most recently used window.In my vision, MRU based algorithm for window switcher makes more sense given the workflow I'm used to on Windows and macOS.
tldr: This change introduces optional MRU cycling while keeping the switcher responsive and performant.
Type of Change
Related Issue
Closes #4103
Testing
Unit tests were run, with all passing.
just formatcommand was run before commits too.For manual verification, I toggled the option inside shell->window switcher->MRU configuration and tried messing with ALT+TAB and both new MRU and old algorithm worked as expected.
Manual Coverage
Screenshots / Videos
N/A
Checklist
CONTRIBUTING.md.just formatwith clang-format v22+ installed, or this PR has no code changes.docs/user/when this PR changes documented behavior or configuration, or this PR does not require documentation changes.assets/translations/en.json, or this PR adds no new user-facing strings.Additional Notes
Besides tests only occurred on Hyprland, the code added was meant to be compositor agnostic, creating an MRU list in 'window_switcher.cpp`, so I think it will not be a problem for the other ones