linux: request no-decorations on map, not just realize (T-351)

On KDE Plasma 6 / KWin 6 the frameless chrome still showed the native
title bar even with the decoration code compiled in. The KDE
server-decoration request ran on the GtkWidget "realize" signal, but
GTK's Wayland backend only creates the wl_surface on map — so at realize
gdk_wayland_window_get_wl_surface() was null and the request bailed,
leaving KWin (which defaults to server-side decorations on Wayland) to
draw its title bar.

Also connect the handler to "map", where the surface is live. The realize
pass still does the X11 gdk_window_set_decorations hint and bails harmlessly
on the Wayland part, so no duplicate decoration object is created.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-10 20:24:50 +02:00
co-authored by Claude Opus 4.8
parent 9a8175903b
commit 7cea13c5c0
4 changed files with 21 additions and 0 deletions
+6
View File
@@ -113,7 +113,13 @@ static void clide_app_activate(GApplication* application) {
// D-057: frameless custom chrome.
gtk_window_set_decorated(window, FALSE);
gtk_window_set_title(window, "clide");
// Run the decoration suppression on both realize (the X11 hint) and map. The
// Wayland server-decoration request needs a live wl_surface, which GTK only
// creates on map — at realize gdk_wayland_window_get_wl_surface() is still
// null and the request bails, leaving KWin (which defaults to server-side
// decorations on Wayland) to draw its own title bar (T-351).
g_signal_connect(window, "realize", G_CALLBACK(on_window_realize), nullptr);
g_signal_connect(window, "map", G_CALLBACK(on_window_realize), nullptr);
gtk_window_set_default_size(window, 1280, 720);