From de5c4163418b0b2516264edfd868309f42577b49 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Fri, 15 Sep 2023 04:31:50 -0500 Subject: [PATCH] gtk: handle all close-requests When compiling in any Release mode, the default gtk close-request handler does not properly fire. We only rely on the default handler if we aren't confirming the close. Replace the default handler with our own in all cases (and just destroy the window if we don't need confirmation). Fixes #458 --- src/apprt/gtk.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/apprt/gtk.zig b/src/apprt/gtk.zig index 35791933d..fc6be8942 100644 --- a/src/apprt/gtk.zig +++ b/src/apprt/gtk.zig @@ -596,7 +596,10 @@ const Window = struct { if (surface.window == self) { if (surface.core_surface.needsConfirmQuit()) break; } - } else return false; + } else { + c.gtk_window_destroy(self.window); + return true; + } // Setup our basic message const alert = c.gtk_message_dialog_new(