mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[PR #1413] [MERGED] fix(wm): fix eager focus on hidden stacked window #1392
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/LGUG2Z/komorebi/pull/1413
Author: @alex-ds13
Created: 4/17/2025
Status: ✅ Merged
Merged: 4/17/2025
Merged by: @LGUG2Z
Base:
master← Head:fix/eager-focus📝 Commits (1)
42d4f58fix(wm): fix eager focus on hidden stacked window📊 Changes
1 file changed (+27 additions, -14 deletions)
View changed files
📝
komorebi/src/process_command.rs(+27 -14)📄 Description
When using the eager focus command to focus a window that was hidden on a stack on an unfocused workspace it would load the workspace focus the correct window but keep it cloaked with the previously focused window showing. This would happen because we were focusing the workspace before focusing the window which would create two window focus events, the first one for the previously focused window and the second one for the target window we wanted. The problem was that when the first event was handled it would again refocus that window and cloak the target window again so when the target window focus event came it would ignore it since the
should_managefunction would returnfalsebecause the window was cloaked and had all its window styles asNone, unless we had transparency enabled, in that case it would override it and create a focus loop.This commit fixes this by not loading the newly focused workspace immediately. Instead we first focus the workspace if it is needed without loading it and mark it as needing to be loaded. Then we focus the correct target window and only then do we load the workspace. This way the workspace loads with the correct window already focused.
This is the same approach that is currently being done on the
perform_reconciliationfunction when there is an alt-tab.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.