fix(layout): remove focusWindow
calls from onWindowCreatedTiling
#3233
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.
Abstract
Remove calls to
focusWindow()
from all implementations ofonWindowCreatedTiling()
Bug fixed
commit 05047f6 (#2630) introduced a bug where the active workspace incorrectly changes when using silent workspace methods or rules if the target workspace contains an unlocked group.
Current behaviour
When
moveActiveToWorkspaceSilent
dispatcher to move the active window to a target workspace[workspace silent]
rules to create a window in the target workspaceand the target workspace contains an unlocked group, the active workspace incorrectly changes to the target workspace instead of remaining in the current workspace as intended (not silent).
Expected behaviour
Active workspace should remain the same when
moveActiveToWorkspaceSilent
or[workspace silent]
are used, regardless the content of target workspace.Changes
Upon initial static analysis and debugging results, I respectfully suggest that all direct or indirect callers of
onWindowCreatedTiling()
appear to be callingfocusWindow()
themselves, or implying that their operand is active within the context. Therefore, the following lines may be redundant or betray the intention of their direct or indirect callers.Hyprland/src/layout/DwindleLayout.cpp
Line 344 in 1a6f961
Hyprland/src/layout/MasterLayout.cpp
Line 123 in 1a6f961
Thus they are removed in this patch.
Please let me know if I have overlooked any significant details or drawn any erroneous assumptions in my conclusions.