Client-drawn window frames: GTK apps (GNOME Files) get no second title bar
CI / test (push) Successful in 2m57s

GTK never asks for server-side decoration (it has no xdg-decoration support), so it draws its
own header bar plus a transparent shadow margin around it, and says where the real window is
with xdg_surface.set_window_geometry. Chandra drew its Breeze frame around every window anyway
and blitted the whole buffer from the frame's corner: a second title bar on top, and the
content shifted down/right by the shadow (a see-through gap), with the right/bottom cut off.

- The server reports per window who draws the frame (ToplevelFrame: client-side when the
  client never made a zxdg_toplevel_decoration_v1, plus the window-geometry offset).
- A client-decorated window gets no Chandra frame and fills the frame's whole box
  (HostWindow::client_rect): it is configured for that size, drawn with its buffer shifted by
  the geometry offset (its own shadow drawn around it), and pointer coordinates and popup
  placement use the same origin. Tiling, title-bar hit areas and resize zones are unchanged.
- xdg_toplevel.move / resize (dragging a header bar, a CSD border) start Chandra's move and
  resize drags; they were ignored before.
- Tiled windows get the tiled_left/right/top/bottom states, so GTK drops its shadow and
  rounded corners there.

Checked with real Nautilus 46 and gtk4-demo on the headless native compositor. Tests:
compositor/host/csd_test.mbt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkfW5ttNd831XmdsC5
This commit is contained in:
Claude committed 2026-11-26 01:35:31 +00:00
1 parent b097116ded
commit 90fdda2455
5 files changed
+405 -33

No files matched your search

+9 -6
View File
@@ -157,6 +157,7 @@ fn open_and_configure_client(
socket_path : String,
title : String,
app_id : String,
server_deco? : Bool = true,
) -> (TestWaylandClient, UInt, UInt, UInt, UInt, UInt) {
let c = TestWaylandClient::connect(socket_path).unwrap()
// 1. wl_display.get_registry(id=2)
@@ -206,12 +207,14 @@ fn open_and_configure_client(
w_a.str(app_id)
c.send(w_a.finish_msg(toplevel_id, 3U))
// get_toplevel_decoration
let deco_id = c.alloc_id()
let w_dc = @wayland.WireWriter::new()
w_dc.u32(deco_id)
w_dc.u32(toplevel_id)
c.send(w_dc.finish_msg(deco_mgr_id, 1U))
// get_toplevel_decoration (GTK never does: it draws its own frame)
let deco_id = if server_deco { c.alloc_id() } else { 0U }
if server_deco {
let w_dc = @wayland.WireWriter::new()
w_dc.u32(deco_id)
w_dc.u32(toplevel_id)
c.send(w_dc.finish_msg(deco_mgr_id, 1U))
}
// initial commit
let w_cm = @wayland.WireWriter::new()