Skip to content

fix(stack): Decouple fullscreen stacking layer from focus#4077

Merged
mergify[bot] merged 1 commit into
awesomeWM:masterfrom
Watkurem:fix-firefox-fullscreen-stack
Apr 23, 2026
Merged

fix(stack): Decouple fullscreen stacking layer from focus#4077
mergify[bot] merged 1 commit into
awesomeWM:masterfrom
Watkurem:fix-firefox-fullscreen-stack

Conversation

@Watkurem

@Watkurem Watkurem commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

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. 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.

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.

@codecov

codecov Bot commented Mar 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.47%. Comparing base (4960086) to head (3279beb).
⚠️ Report is 3 commits behind head on master.

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              
Files with missing lines Coverage Δ
stack.c 93.33% <100.00%> (+0.11%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Watkurem Watkurem force-pushed the fix-firefox-fullscreen-stack branch from 1f77055 to 1451edd Compare March 30, 2026 21:51
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>
@Watkurem Watkurem force-pushed the fix-firefox-fullscreen-stack branch from 1451edd to 3279beb Compare March 30, 2026 21:52
@Watkurem

Copy link
Copy Markdown
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.

@Watkurem Watkurem changed the title fix(stack): Restack windows on focus change for fullscreen layer fix(stack): Decouple fullscreen stacking layer from focus Mar 31, 2026

@actionless actionless left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! 😺👍

@Watkurem

Copy link
Copy Markdown
Contributor Author

Is there anything else I need to do? Two reviews are required to merge

@actionless actionless requested a review from Aire-One April 19, 2026 22:46

@Aire-One Aire-One left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @Watkurem

@Aire-One

Copy link
Copy Markdown
Member

@Mergifyio queue

@mergify

mergify Bot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • 🟠 Waiting for queue conditions
  • ⏳ Enter queue
  • ⏳ Run checks
  • ⏳ Merge
Waiting for:
  • -closed
All conditions
  • -closed [📌 queue requirement]
  • -conflict [📌 queue requirement]
  • -draft [📌 queue requirement]
  • any of [📌 queue -> configuration change requirements]:
    • -mergify-configuration-changed
    • check-success = Configuration changed
  • any of [🔀 queue conditions]:
    • all of [📌 queue conditions of queue rule default]:
      • #approved-reviews-by >= 2 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • any of [🛡 GitHub branch protection]:
        • check-success = codecov/patch
        • check-neutral = codecov/patch
        • check-skipped = codecov/patch

@mergify mergify Bot merged commit aae5d25 into awesomeWM:master Apr 23, 2026
11 checks passed
@mergify mergify Bot added queued and removed queued labels Apr 23, 2026
@Watkurem Watkurem deleted the fix-firefox-fullscreen-stack branch April 23, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fullscreen Firefox intermittently stays visually on top, ignoring client focus

3 participants