feat: GNOME support via a transparent click-through overlay backend - #17
Merged
Conversation
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.
Summary
Fixes #16 — on GNOME the drawer came up as a small unusable box in the middle of
the screen.
The drawer anchors itself with the layer-shell protocol (
zwlr_layer_shell_v1),which is a wlroots extension, not part of
wayland-protocols. KWin, Hyprlandand Sway implement it; GNOME's Mutter never has. We called
InitForWindowwithout a support check, and the failure is silent: the library logs one
G_LOG_LEVEL_WARNINGand returns, then everySetLayer/SetAnchor/SetMargin/SetMonitor/SetKeyboardModewarns once and no-ops. Nothing aborts. Since thetop+bottom anchors were the only thing supplying a height, the window collapsed.
This is not a library-version problem and not a "GNOME doesn't support Wayland"
problem, and no package can fix it —
gtk4-layer-shellis the client side andis already a package dependency; the protocol has to come from the compositor.
Adds a third backend selected automatically when layer-shell is unavailable: a
fullscreen transparent window with the drawer against the right edge, its input
region restricted to the drawer so everything outside is click-through and the
rest of the desktop stays usable. Core Wayland gives a client no way to position
its own window, so fullscreen is what makes edge placement possible at all.
Changes
internal/gui/overlay— new backend (fullscreen, transparent,click-through) implementing the existing 5-method
Backendinterface.internal/panelgeom— new pure package for the panel rectangle and slideinterpolation, with invariant tests. Picked up automatically by
PURE_PKGS.gui.go— three-branch backend selection.layerShellUsable()checks theGDK backend before calling
IsSupported(), which asserts on a non-Waylanddisplay and would otherwise log
assertion 'GDK_IS_WAYLAND_DISPLAY' failedatCRITICAL in every X11 session.
layershell.go— stop loggingbackend mode=layer-shellunconditionally.It reported success even when init had failed, which is the single most
misleading line in the diagnostic path and why Creates a small window at the center of the screen that cannot be interacted with. #16 looked like a rendering bug.
controls.go/tdp.go— three identicalScrolledWindowsetups replacedby one
newDrawerScroll()withSetMinContentHeight. A GtkScrolledWindowreports a minimum height of 0 and
SetVExpandonly distributes surplus, sowith nothing sizing the window from outside the drawer collapses. Deliberately
not
SetPropagateNaturalHeight(true)— that trades no default size for a badone (the custom view would request more than the screen height).
what is degraded), plus troubleshooting for
journalctl --user: ours is asystemd user unit, and
sudo journalctl -u z13guiprints-- No entries --,which reads as though the program never ran. That is what sent the reporter
down the wrong path.
IsSupported()" rule and the new backend.Testing
make build,make fmt-check,make lint(0 issues),make test(11 packages),make raceall pass.Verified on hardware (KDE, using
GDK_BACKEND=x11to force the same"no layer surface" path GNOME takes):
GDK_BACKEND=x11→backend mode=overlay;native Wayland →
backend mode=layer-shell protocolVersion=4, unchanged.panel={Y:80 H:1440}on a 2560x1600 output — 5% margins, full height.GtkFixedallocates childrentheir natural size and
SetSizeRequestis only a minimum, so the panel cameout 343px wide against a 320px request (CSS border/padding) and hung 23px past
the screen edge, clipping the second column of every row. Positioning now
derives from the allocated width:
x=2217 w=343→ right edge exactly 2560.overlay: dismissing on focus loss).GtkGizmoslider warnings appear identically on apre-change baseline binary, so they are pre-existing.
panelgeomtests fail when the width clamp is mutated, i.e. not vacuous.mkdocs build --strictpasses; verifiedid="gnome-support"exists in thegenerated HTML and all five cross-links resolve.
Not verified — needs a real GNOME session. KWin is not Mutter:
xdotool getmouselocationresolves to a compositor container under XWayland and
xwininfodoes not exposethe input shape, so neither could confirm it.
appears in Alt-Tab. Both are documented as "may". If the top bar behaviour is
objectionable the fallback is a monitor-sized non-fullscreen window — at exactly
monitor size the compositor's own placement lands it correctly, so positioning
is still not needed. One-line change.
GDK_BACKEND=x11GTK reports scale 1, so the drawer renders at343 physical px and looks small; on GNOME Wayland it should get the compositor
scale natively.
Checklist
make buildpassesmake lintpassesgo test ./internal/theme/ -vpasses