Skip to content

Conversation

@LoayGhreeb
Copy link

This PR fixes MRU focus window tracking when the overview is open. The issue was that Alt+Tab would work once, but subsequent presses wouldn't switch back to the previous window.

The root cause is that MRU timestamps were updated based on keyboard focus changes, but when the overview is open, keyboard focus stays on the overview even though layout focus changes (via arrow keys, MRU advances, or opening new windows).

The fix adds a previous_layout_focus_id field to track layout focus separately from keyboard focus. On each refresh cycle, if the layout focus changed, the MRU timestamp is updated for the newly focused window.

Fixes: #2834
Fixes: #2839

Track layout focus separately from keyboard focus for MRU timestamps.
When the overview is open, keyboard focus is on the overview itself, but layout focus can still change via arrow keys, MRU advances, or opening new windows.
@YaLTeR
Copy link
Owner

YaLTeR commented Nov 27, 2025

I'm still somewhat undecided what's the expected/correct way for this to work, if it's keyboard focus or layout focus. One potential argument for keyboard focus is supporting layer surfaces in the future, though also not sure if they should be present in the same menu.

@LoayGhreeb
Copy link
Author

One potential argument for keyboard focus is supporting layer surfaces in the future

I'm wondering why this would be an argument in this case?

As far as I understand, layer surfaces could still be tracked separately using keyboard focus, regardless of whether we use keyboard focus or layout focus to detect focus changes for windows. So if layer surfaces need to be tracked in the future, they could use keyboard focus if that's the correct detection method for them.

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.

Small issue with Alt+Tab Inconsistent recents behavior in overview

2 participants