Skip to content

feat(switcher): add MRU order option - #4168

Open
SirMonteiro wants to merge 2 commits into
noctalia-dev:mainfrom
SirMonteiro:window-switcher-mru
Open

feat(switcher): add MRU order option#4168
SirMonteiro wants to merge 2 commits into
noctalia-dev:mainfrom
SirMonteiro:window-switcher-mru

Conversation

@SirMonteiro

Copy link
Copy Markdown

Summary

Added Most Recently Used (MRU) window sorting support to WindowSwitcher when shell.windowSwitcher.mru is enabled.

Motivation

Previously, WindowSwitcher sorted 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

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Build / packaging

Related Issue

Closes #4103

Testing

Unit tests were run, with all passing. just format command 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

  • Tested on Niri
  • Tested on Hyprland
  • Tested on Sway
  • Tested on another compositor:
  • Tested with different bar positions and density settings
  • Tested at different interface scaling values
  • Tested with multiple monitors

Screenshots / Videos

N/A

Checklist

  • This PR is ready for review, or it is marked as Draft.
  • I read and followed the relevant guidance in CONTRIBUTING.md.
  • I ran just format with clang-format v22+ installed, or this PR has no code changes.
  • I ran the relevant build or test commands, or explained why they were not run.
  • I self-reviewed the changes.
  • I checked for new warnings or errors.
  • I updated user-facing documentation in docs/user/ when this PR changes documented behavior or configuration, or this PR does not require documentation changes.
  • I added or updated assets/translations/en.json, or this PR adds no new user-facing strings.
  • I did not edit non-English translation files unless this PR is explicitly for translation tooling, an import/export sync, or a maintainer-requested locale change.
  • I used the existing canonical names for config keys, IPC names, paths, and identifiers.

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

@ramboe

ramboe commented Aug 31, 2026

Copy link
Copy Markdown

much appreciated!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Most Recently Used sorting for window switcher

2 participants