fix(stack): Decouple fullscreen stacking layer from focus#4077
Open
Watkurem wants to merge 1 commit intoawesomeWM:masterfrom
Open
fix(stack): Decouple fullscreen stacking layer from focus#4077Watkurem wants to merge 1 commit intoawesomeWM:masterfrom
Watkurem wants to merge 1 commit intoawesomeWM:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4077 +/- ##
==========================================
- Coverage 90.47% 90.47% -0.01%
==========================================
Files 941 941
Lines 60391 60392 +1
Branches 1145 1145
==========================================
- Hits 54638 54637 -1
- Misses 5246 5248 +2
Partials 507 507
🚀 New features to boost your workflow:
|
1f77055 to
1451edd
Compare
Fullscreen clients are assigned a special stacking layer via client_layer_translator(). Previously, this was conditioned on the client having focus. When switching focus away from a fullscreen client (e.g. via awful.client.focus.byidx), the fullscreen client could intermittently remain visually on top despite losing focus, because the layer reassignment depended on a restack that was not always triggered by the focus change. This is fixed by conditioning the fullscreen layer on the client being at the top of the internal stack (i.e. the most recently raised client) rather than on focus. Since keyboard focus changes go through raise(), the fullscreen layer is correctly updated when switching away. Sloppy mouse-enter focus (which does not call raise) is unaffected, as it does not alter the internal stack order. Signed-off-by: Alexander Melnyk <inboxnumberzero@zoho.com>
1451edd to
3279beb
Compare
Contributor
Author
|
I found an issue with my original attempt at this fix. Forcing a restack on every focus broke "sloppy focus" (as in, focusing a window when the mouse cursor enters it, but without raising it to visibility), which, at least for me, is a big deal. I didn't notice this problem at first, because all my fullscreen clients sit on the same tag (so it's normally impossible to do sloppy focus stuff with them) 🤡 After digging into it some more, I took a different approach, which seems to make more sense (and which I didn't find a way to break yet). Input would be appreciated, though. |
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.
Fixes #4075
Fullscreen clients are assigned a special stacking layer via
client_layer_translator(). Previously, this was conditioned on the client having focus. When switching focus away from a fullscreen client (e.g. viaawful.client.focus.byidx), the fullscreen client could intermittently remain visually on top despite losing focus, because the layer reassignment depended on a restack that was not always triggered by the focus change.This is fixed by conditioning the fullscreen layer on the client being at the top of the internal stack (i.e. the most recently raised client) rather than on focus. Since keyboard focus changes go through
raise(), the fullscreen layer is correctly updated when switching away. Sloppy mouse-enter focus (which does not callraise) is unaffected, as it does not alter the internal stack order.I'm wondering whether this has a potential of causing issues when the client is set as fullscreen without raising (when could this happen? Could a client be spawned as fullscreen, but not raised? Should it even be given its own layer in that case?). One might switch to a client without raising it — but, once again, should the client be given its own layer in that case?
Admittedly, I'm not very familiar with Awesome's internals and don't really know what I'm doing, but, hopefully, this is at least close to a proper fix.
I'm not sure how to properly auto-test for this... Let me know in case a test is required, and I'll try to figure it out.