fix: panels stay above windows; don't force SSD on CSD-only (GTK) clients#67
Merged
Conversation
Two related decoration/stacking bugs surfaced by GTK windows and Waybar. 1) Windows occluded Waybar. Toplevels were created as direct children of the scene root, appended after the per-output layer-shell trees, so every window rendered above the top/overlay layers where panels live. Server-side-decorated windows showed it worst (their titlebar pokes above the client geometry into the panel's row); CSD windows like Chromium/pcmanfm have no such overhang so they looked fine. Add a dedicated server->toplevel_tree and stack each output's layer trees around it: background/bottom below, top above, fullscreen above top, overlay on top. Toplevels are children of toplevel_tree, so focus-raising a window never lifts it above the panel layers. Fullscreen windows are reparented into the fullscreen layer so they still cover panels, and back to toplevel_tree when restored. 2) GTK windows mushroomed when dragged and showed conflicting decorations. GTK never binds the xdg-decoration protocol (it is CSD-only and draws its own titlebar + shadow, reporting a shadow-offset xdg geometry). We nonetheless imposed an SSD frame whenever DecorMode resolved to server-side, producing a double titlebar and broken drag geometry. Gate SSD on the client actually participating in xdg-decoration: if a toplevel has no decoration object, it is CSD-only and we leave its decorations alone. Clients that bind the protocol (foot, most native Wayland apps) still get themed server-side frames and honour DecorMode. Verified: full suite 27 green (g++/ASan), clang + release clean; headless shows wbconf (GTK4) maps as CSD with no frame while foot keeps its SSD frame, no double decoration, no crash. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 two related decoration/stacking bugs you hit with GTK windows and Waybar.
1. Windows occluded Waybar
Toplevels were direct children of the scene root, created after the per-output layer-shell trees, so every window rendered above the
top/overlaylayers where panels live. SSD windows showed it worst — their titlebar pokes above the client geometry into the panel's row — while CSD apps (Chromium, pcmanfm) have no overhang so they looked fine.Fix: add a dedicated
server->toplevel_treeand stack each output's layer trees around it — background/bottom below,topabove,fullscreenabovetop,overlayon top. Toplevels are children oftoplevel_tree, so focus-raising a window never lifts it above the panel layers. Fullscreen windows are reparented into the fullscreen layer (so they still cover panels) and back when restored.2. GTK windows "mushroomed" on drag + double decorations
GTK never binds the xdg-decoration protocol — it is CSD-only, draws its own titlebar + shadow, and reports a shadow-offset xdg geometry (e.g.
+14+12). We nonetheless imposed an SSD frame wheneverDecorModeresolved to server-side, giving wbconf a double titlebar and broken drag geometry (the "mushroom").Fix: gate SSD on the client actually participating in xdg-decoration. If a toplevel has no decoration object it's CSD-only and we leave it alone. Clients that bind the protocol (foot, most native Wayland apps) still get themed server-side frames and honour
DecorMode.Testing
deco=(nil)+ shadow-offset geometry vs foot's real decoration object.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com