From 5661cb9a8f28f192ed812758f8fa70eb8c9ff64e Mon Sep 17 00:00:00 2001 From: ebenali <54529923+ebenali@users.noreply.github.com> Date: Sun, 21 Jun 2026 16:40:32 +0000 Subject: [PATCH] fix(wbconf): add a header bar so the window has a proper draggable titlebar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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> --- wbconf/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wbconf/main.cpp b/wbconf/main.cpp index 4e80a90..f3f4dc7 100644 --- a/wbconf/main.cpp +++ b/wbconf/main.cpp @@ -442,6 +442,15 @@ void build_window(GtkApplication *app, Ui *ui) { gtk_window_set_title(ui->window, _("Waybox Configuration Manager")); gtk_window_set_default_size(ui->window, 500, 460); + /* An explicit header bar: GTK then owns a proper, draggable client-side + * titlebar (a GtkWindowHandle) that drives compositor move/maximize + * correctly. Without one, a decorated GtkWindow falls back to a degenerate + * titlebar that misbehaves under a wlroots compositor (the window can jump + * or resize on drag). waybox leaves GTK windows client-side decorated + * because GTK does not implement the server-side xdg-decoration protocol. */ + GtkWidget *header = gtk_header_bar_new(); + gtk_window_set_titlebar(ui->window, header); + GtkWidget *vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); gtk_window_set_child(ui->window, vbox);