-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Properly focus container when it changes parent #8526
base: master
Are you sure you want to change the base?
Conversation
When a parented container changes parent, sway will render a sibling non-focused container. Revert deletion of code which introduced this regression. Fixes: 5e18ed3 Fixes: swaywm#8292
Kind bump? This is a really annoying regression since 1.10. |
It seems this behavior is intended by the "regression" PR, which claims that this behavior is correct for i3. |
This was not reproducible on i3 last I checked. Have you reproduced the bug yourself? When moving windows through a tabbed container, sway will at some point render another window, while indicating that the one being moved is still focused. The commit that broke this says:
I've found why this code is here, if fixes this particular issue. Maybe i3 doesn't need it because this corner case is handled elsewhere, I have no idea. |
Here's a video reproducing the behaviour: https://mirror.whynothugo.nl/t/sway-issue-8292.mkv I start out with a tabbed container with:
I focus terminal (4), and move it left two times. It is now inside the horizontal split, sway marks the horizontal split as focused, but renders the surface from the I then type |
Huh, yeah this is definitely a real issue. I find it strange that it doesn't render anything at all, focusing/unfocusing shouldn't affect rendering to this extent. |
When you just move plain left, no focus or render state is changed - only the parent's title updates. The issue is that a container is moved from being a direct child of its parent to being a grandchild. Lines 125 to 134 in 962e1e7
What we need to do in this case is change the container state to match the new parent, instead of being reset to the random child. This would also have to apply to the two reparenting scenarios below this one. I'm not sure if i3 has any caveats if, say, you're moving unfocused containers - maybe visibility only changes if the container moved was initially visible or focused. The commit removing the workaround suggests we were doing too much refocusing compared to i3 at least. It's better to be functional than to be correct though. |
What determines which child is chosen to render? The focus seems to remain correct (I can still keyboard interact with the non-visible window). I considered forcing focus for the new parent if the child was already focused, but we don't even have a seat in scope. |
When a parented container changes parent, sway will render a sibling non-focused container.
Revert deletion of code which introduced this regression.
Fixes: 5e18ed3
Fixes: #8292