fix(stack): Decouple fullscreen stacking layer from focus#4077
fix(stack): Decouple fullscreen stacking layer from focus#4077Watkurem 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
|
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. |
|
Is there anything else I need to do? Two reviews are required to merge |
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.