From bc177a2d66492527cef7dd63ca656971e1ca06c0 Mon Sep 17 00:00:00 2001 From: Michael Grant Date: Sun, 20 Sep 2026 22:38:45 +0100 Subject: [PATCH] layout-custom: emit an empty v1 body for windows with only floating panes layout_append() returned failure for the version 1 (old) layout format when a window's tree has no tiled cell anywhere - e.g. a window left with only floating panes after the last tiled pane closed. layout_dump() turns that failure into NULL, surfacing as an empty #{window_layout} instead of the minimal valid placeholder body a control client or select-layout round-trip expects. Return success with nothing written instead, which composes into the checksum-prefixed empty body via the existing formatting path. Co-Authored-By: Claude Sonnet 5 --- layout-custom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout-custom.c b/layout-custom.c index 48b12a967..afe399cd0 100644 --- a/layout-custom.c +++ b/layout-custom.c @@ -509,7 +509,7 @@ layout_append(struct layout_cell *lcroot, struct layout_string *ls, int flags) if (flags & LAYOUT_CUSTOM_OLD_FORMAT) { if (!layout_cell_is_tiled(lcroot) && !layout_cell_has_tiled_child(lcroot)) - return (-1); + return (0); /* no tiled cell anywhere: empty v1 body */ lccompat = layout_custom_create_compat(lcroot); result = layout_append_v1(lccompat, ls); layout_custom_free_compat(lccompat);