diff --git a/include/ghostty.h b/include/ghostty.h index d28dcd095..001ffb249 100644 --- a/include/ghostty.h +++ b/include/ghostty.h @@ -396,6 +396,7 @@ ghostty_surface_t ghostty_surface_new(ghostty_app_t, ghostty_surface_config_s*); void ghostty_surface_free(ghostty_surface_t); ghostty_app_t ghostty_surface_app(ghostty_surface_t); bool ghostty_surface_transparent(ghostty_surface_t); +bool ghostty_surface_needs_confirm_quit(ghostty_surface_t); void ghostty_surface_refresh(ghostty_surface_t); void ghostty_surface_set_content_scale(ghostty_surface_t, double, double); void ghostty_surface_set_focus(ghostty_surface_t, bool); diff --git a/src/apprt/embedded.zig b/src/apprt/embedded.zig index d66682528..c4ae49e88 100644 --- a/src/apprt/embedded.zig +++ b/src/apprt/embedded.zig @@ -1206,6 +1206,11 @@ pub const CAPI = struct { return surface.app.config.@"background-opacity" < 1.0; } + /// Returns true if the surface needs to confirm quitting. + export fn ghostty_surface_needs_confirm_quit(surface: *Surface) bool { + return surface.core_surface.needsConfirmQuit(); + } + /// Tell the surface that it needs to schedule a render export fn ghostty_surface_refresh(surface: *Surface) void { surface.refresh();