Skip to content

Fix MRU ordering across workspaces - #5

Open
ovsw wants to merge 2 commits into
piyush97:mainfrom
ovsw:fix/cross-workspace-mru
Open

Fix MRU ordering across workspaces#5
ovsw wants to merge 2 commits into
piyush97:mainfrom
ovsw:fix/cross-workspace-mru

Conversation

@ovsw

@ovsw ovsw commented Aug 31, 2026

Copy link
Copy Markdown

Summary

  • seed global MRU ordering from authoritative Hyprland client history
  • keep the ordering current through activewindowv2 focus events
  • normalize window addresses and preserve focus events that race initial seeding
  • avoid a Qt 6.11 crash when window cycling requests arrive in a burst
  • add regression coverage for stale cached ranks across workspaces

Problem

Quickshell window objects cache lastIpcObject. Focusing a window changes every client focusHistoryID, but not every cached object refreshes. This can leave cross-workspace windows with stale ranks, so the first Alt+Tab selection is not the globally last-used window.

Rapid cycling also exposed a Qt 6.11 crash. Updating ListView.currentIndex while Qt was creating delegates for the JavaScript array model could crash the entire Quickshell process. The list already draws its selected row itself, so this change removes the fragile currentIndex binding and required delegate properties. A zero-delay timer combines repeated scroll requests and keeps the selected row visible.

The plugin is already kept loaded. This change seeds an address-based MRU list from hyprctl clients -j when loaded, then promotes addresses on activewindowv2 events. The live address order takes precedence over cached ranks while retaining the existing fallback for untracked windows.

Validation

  • manually verified quick Ctrl+Tab selects the globally previous window across workspaces
  • sent 1,000 cycle requests with 32 concurrent workers; Quickshell kept the same PID and created no new core dump
  • node test_model.js
  • omarchy plugin validate .
  • git diff --check
  • CodeRabbit CLI review: 0 findings

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.

1 participant