[turbine,studio] Fix confirm app close pop up to work with Ctrl-Q
All checks were successful
Build / build (push) Successful in 2m1s

This commit is contained in:
Gary Talent 2025-05-06 23:23:24 -05:00
parent 136f422401
commit cd43fb7f38
4 changed files with 8 additions and 5 deletions

View File

@ -588,7 +588,7 @@ ox::Error StudioUI::makeCopyDlg(ox::StringViewCR path) noexcept {
ox::Error StudioUI::handleCloseAppResponse(ig::PopupResponse const response) noexcept {
if (response == ig::PopupResponse::OK && m_activeEditor) {
turbine::requestShutdown(m_tctx);
turbine::requestShutdown(m_tctx, true);
}
return {};
}

View File

@ -27,7 +27,7 @@ ox::Error run(Context &ctx) noexcept;
[[nodiscard]]
TimeMs ticksMs(Context const&ctx) noexcept;
void requestShutdown(Context &ctx) noexcept;
void requestShutdown(Context &ctx, bool force = false) noexcept;
using ShutdownHandler = bool (*)(Context&);

View File

@ -82,7 +82,7 @@ bool buttonDown(Context const&, Key k) noexcept {
return k <= Key::GamePad_L && !(REG_GAMEPAD & (1 << static_cast<int>(k)));
}
void requestShutdown(Context &ctx) noexcept {
void requestShutdown(Context &ctx, bool) noexcept {
ctx.running = false;
}

View File

@ -125,8 +125,11 @@ bool buttonDown(Context const&ctx, Key const key) noexcept {
return (ctx.keysDown >> static_cast<int>(key)) & 1;
}
void requestShutdown(Context &ctx) noexcept {
ctx.running = false;
void requestShutdown(Context &ctx, bool const force) noexcept {
glfwSetWindowShouldClose(ctx.window, true);
if (force) {
ctx.running = false;
}
}
void setShutdownHandler(Context &ctx, ShutdownHandler const handler) noexcept {