fix(wbconf): add a header bar for a proper draggable titlebar#69
Merged
Conversation
…tlebar wbconf is a GtkApplicationWindow with no titlebar widget. GTK does not implement the server-side xdg-decoration protocol, so waybox correctly leaves GTK windows client-side decorated (see the SSD gating in decoration.cpp). But a *decorated* GtkWindow with no header bar falls back to a degenerate client-side titlebar that misbehaves under a wlroots compositor — dragging it could make the window jump or appear to expand, and it had no proper drag/maximize affordance. Give wbconf an explicit GtkHeaderBar (gtk_window_set_titlebar). GTK then owns a real, draggable titlebar backed by a GtkWindowHandle, which drives the compositor's interactive move/maximize through the normal xdg_toplevel requests. This is the standard GTK4 application structure and resolves the broken drag-to-move behaviour reported for wbconf. Verified: full suite 27 green (g++/ASan); clang + release clean; wbconf maps cleanly under headless waybox with the header bar and no ASan/GTK errors. (Interactive drag could not be reproduced under the headless backend because GTK's renderer loses its surface there; the fix is the standard GTK4 pattern and the missing piece the symptom pointed to.) 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.
Symptom
Dragging wbconf "by the titlebar" made the window expand/"mushroom" and lose its titlebar — while other apps (Chromium, pcmanfm) were fine.
Diagnosis
With temporary instrumentation I confirmed wbconf is pure client-side decorated:
want=0, no waybox frame,deco=(nil), GTK shadow-offset geometry (+14+12). GTK4 does not implement the server-side xdg-decoration protocol, so waybox correctly leaves GTK windows CSD (the SSD gating added earlier). So the misbehaviour is GTK-side, not a waybox frame.The real gap (as you suspected — "incompleteness in wbconf"): wbconf is a
GtkApplicationWindowwith no titlebar widget. A decorated GtkWindow with no header bar falls back to a degenerate CSD titlebar that misbehaves under a wlroots compositor and has no proper drag/maximize affordance.Fix
Give wbconf an explicit
GtkHeaderBarviagtk_window_set_titlebar(). GTK then owns a real, draggable titlebar (aGtkWindowHandle) that drives the compositor's interactive move/maximize through the normalxdg_toplevelrequests — the standard GTK4 app structure.On your "drive a seat from the cmdline" question
Yes — that's what the Wayland virtual-input protocols are for. I prototyped a
zwlr_virtual_pointer_v1press/move/release CLI to drive drags. The blocker for reproducing this headlessly turned out to be GTK's renderer losing its surface under the headless backend (VK_ERROR_SURFACE_LOST_KHR);GSK_RENDERER=cairomakes headless GTK render, but the CSD move gesture still doesn't replay reliably. I've filed a todo to generalise that prototype into a committed, reusable scriptable-input test helper.Testing
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com