summaryrefslogtreecommitdiff
path: root/src/App.zig
diff options
context:
space:
mode:
authorMitchell Hashimoto <mitchell.hashimoto@gmail.com>2023-09-11 15:44:08 -0700
committerMitchell Hashimoto <mitchell.hashimoto@gmail.com>2023-09-11 15:44:08 -0700
commit56ccadd7f1de5df4041d475a1af9c051e034ffbc (patch)
tree9ef0d5fa2e7499d4daccef8a3b12f18af25bf5dd /src/App.zig
parentf96eb077333ea1be08bb563f29211b3d8e5563ce (diff)
core: app needsConfirmQuit to streamline quitting if no active sessions
Diffstat (limited to 'src/App.zig')
-rw-r--r--src/App.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/App.zig b/src/App.zig
index 942581e3e..4b88c30e7 100644
--- a/src/App.zig
+++ b/src/App.zig
@@ -168,6 +168,16 @@ pub fn focusedSurface(self: *const App) ?*Surface {
return surface;
}
+/// Returns true if confirmation is needed to quit the app. It is up to
+/// the apprt to call this.
+pub fn needsConfirmQuit(self: *const App) bool {
+ for (self.surfaces.items) |v| {
+ if (v.core_surface.needsConfirmQuit()) return true;
+ }
+
+ return false;
+}
+
/// Initialize once and return the font discovery mechanism. This remains
/// initialized throughout the lifetime of the application because some
/// font discovery mechanisms (i.e. fontconfig) are unsafe to reinit.