From fc90a4a05235b2980b67d67a4cb030eb2a3a2bcf Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 11 Sep 2023 15:53:20 -0700 Subject: [PATCH] apprt/gtk: do not ask for confirm window close if all surfaces idle --- src/apprt/gtk.zig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/apprt/gtk.zig b/src/apprt/gtk.zig index cd04022d7..54e805dd1 100644 --- a/src/apprt/gtk.zig +++ b/src/apprt/gtk.zig @@ -594,6 +594,13 @@ const Window = struct { log.debug("window close request", .{}); const self = userdataSelf(ud.?); + // If none of our surfaces need confirmation, we can just exit. + for (self.app.core_app.surfaces.items) |surface| { + if (surface.window == self) { + if (surface.core_surface.needsConfirmQuit()) break; + } + } else return false; + // Setup our basic message const alert = c.gtk_message_dialog_new( self.window,