From 13e26f92b0c16c9d0ceb68af821b202f238c50fa Mon Sep 17 00:00:00 2001 From: foxnne Date: Sun, 18 Oct 2026 17:12:22 -0500 Subject: [PATCH] backend: dvui's Debug window tears off too dvui draws its Debug window, dialogs and toasts late, in drawRetained, which the backend ran after the tear-off looked for the floating window being dragged, and only with OS windows open. So the Debug window was not yet drawn this frame (`used`) nor noted as closable when the tear-off looked, and never tore off (the user; diagnosed by the session on fizzyedit/fizzy#584). With tear-off on, the retained layer is now drawn first; drawRetained keeps to once a frame, and Window.end would have drawn it at this point anyway. --- backend/src/os_windows.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/src/os_windows.zig b/backend/src/os_windows.zig index 871e159d1..a5201a8ca 100644 --- a/backend/src/os_windows.zig +++ b/backend/src/os_windows.zig @@ -624,6 +624,11 @@ fn endTear(t: *Tear) void { /// After the app's frame, before `dvui.Window.end`. pub fn afterFrame() void { + // What dvui draws late — its Debug window, dialogs, toasts — drawn before the tear-off looks for + // the floating window being dragged: drawn after, the Debug window was not yet drawn (`used`) + // nor asked about (`closable`) when it looked, and never tore off (the user). Once a frame + // (`drawRetained` keeps to that), and `Window.end` would draw them here anyway. + if (viewports.tears()) dvui.currentWindow().drawRetained(.{}); tearFrame(); if (named_n == 0 and for (outs) |slot| { if (slot != null) break false;