Skip to content

fix: panels stay above windows; don't force SSD on CSD-only (GTK) clients#67

Merged
ebenali merged 1 commit into
masterfrom
fix-move-grab-and-layering
Jun 21, 2026
Merged

fix: panels stay above windows; don't force SSD on CSD-only (GTK) clients#67
ebenali merged 1 commit into
masterfrom
fix-move-grab-and-layering

Conversation

@ebenali

@ebenali ebenali commented Jun 21, 2026

Copy link
Copy Markdown
Member

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/overlay layers 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_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 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 whenever DecorMode resolved 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

  • Full suite 27 green (g++/ASan/UBSan); clang + release clean.
  • Headless: wbconf (GTK4) maps as CSD with no frame (no double decoration, no mushroom) while foot keeps its themed SSD frame; no crashes/ASan findings.
  • Diagnosed live with temporary logging showing GTK4 deco=(nil) + shadow-offset geometry vs foot's real decoration object.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

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>
@ebenali
ebenali merged commit 8326380 into master Jun 21, 2026
4 checks passed
@ebenali
ebenali deleted the fix-move-grab-and-layering branch June 21, 2026 16:06
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.

1 participant