Repository navigation
fix(wm): preserve monocle visibility and focus on external activation - #1772
Open
MattKotsenas wants to merge 1 commit into
Open
MattKotsenas wants to merge 1 commit into
MattKotsenas wants to merge 1 commit into
Conversation
The duplicate-management guard bypassed monocle visibility handling for existing tiled windows revealed by external activation. Handle them before skipping window addition, retaining the duplicate protection and existing reconciliation paths. Restore foreground input to the monocle window only when the revealed window was foreground. Keep background events from stealing focus and leave floating windows alone. Cover the event path with native-window regression tests and an opt-in desktop test for actual cloaking and foreground focus.
This branch has not been deployed
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
Keep monocle exclusive when an external activation reveals another managed tiled window. For example, Ctrl+clicking a link in a monocled terminal can activate an existing browser window. Before this change, the browser could become visible and receive input while komorebi's monocle target and border remained on the terminal.
With this change, the browser still opens the link, but komorebi re-hides it and restores input focus to the monocle window. Monocle stays enabled, and window and stack membership stay unchanged.
Implementation
The duplicate-management guard skips adding windows that are already managed. That also bypassed the existing monocle visibility handling.
This change handles monocle visibility in the already-managed path before skipping window addition. It re-hides the window only when it belongs to a regular tiled container on the focused workspace, the tiling layer is active, and a monocle window exists. It restores focus only if the revealed window was foreground, so background events do not steal input.
The duplicate-management guard and reconciliation ordering are retained. Floating windows and the monocle window itself are excluded from this repair.
Validation
UncloakandShow, plus preservation of unmanaged foreground focus during a backgroundUncloak. Disabling the explicit refocus made it fail.