diff --git a/window.c b/window.c index cbe65c615..be2048321 100644 --- a/window.c +++ b/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.374 2026/09/08 08:37:56 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.375 2026/09/20 07:35:06 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -451,9 +451,17 @@ window_create(u_int sx, u_int sy, u_int xpixel, u_int ypixel) static void window_destroy(struct window *w) { + struct window_pane *wp; + log_debug("window @%u destroyed (%d references)", w->id, w->references); - window_unzoom(w, 0); + if (w->flags & WINDOW_ZOOMED) { + w->flags &= ~WINDOW_ZOOMED; + TAILQ_FOREACH(wp, &w->panes, entry) { + wp->flags &= ~PANE_ZOOMED; + wp->saved_layout_cell = NULL; + } + } RB_REMOVE(windows, &windows, w); layout_free_cell(w->layout_root, 0);