sway/workspaces: Made the focused check in "current-only" fully recursive #3847
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.
I was experiencing a similar version of issue #3369. However, in my case, the issue only kicked in when a tabbed container was in use. I noticed that PR #3336 attempted to address the issues with current-only by not only checking whether the workspace itself is focused, but also whether any window within it is focused.
However, it did not check recursively. This meant that if the focused window was at the top level, it would be detected. Or if it was in a container that sway decided to also indicate as focused. (It's really not clear to me how Sway decides when to indicate a container as focused.) But if the window is in a container not indicated as focused, it will be missed. This seems to happen often with tabbed containers. Changing this check to be recursive seems to fix it.