diff --git a/Sources/Core/Window/Window.swift b/Sources/Core/Window/Window.swift index 92c7266..7320616 100644 --- a/Sources/Core/Window/Window.swift +++ b/Sources/Core/Window/Window.swift @@ -92,8 +92,8 @@ public struct Window: AdwaitaSceneElement { /// Close the window. case close - /// Keep the window. - case keep + /// Cancel the closing process and keep the window. + case cancel } @@ -262,7 +262,7 @@ public struct Window: AdwaitaSceneElement { } } if let onClose { - storage.fields["on-close"] = { onClose() == .keep } as (() -> Bool) + storage.fields["on-close"] = { onClose() == .cancel } as (() -> Bool) } storage.previousState = self } diff --git a/Sources/Demo/Demo.swift b/Sources/Demo/Demo.swift index 6b118c0..be70ae5 100644 --- a/Sources/Demo/Demo.swift +++ b/Sources/Demo/Demo.swift @@ -212,7 +212,7 @@ struct Demo: App { window .size(width: $width, height: $height) .maximized($maximized) - .onClose { closeAlert = !destroy; return destroy ? .close : .keep } + .onClose { closeAlert = !destroy; return destroy ? .close : .cancel } } }