Fix quit prompt not appearing when closing the game from the taskbar.

This commit is contained in:
Skyth 2025-02-07 01:13:19 +03:00
parent dc39969ccd
commit 12b967b622

View file

@ -175,19 +175,19 @@ public:
if (!InstallerWizard::s_isVisible) if (!InstallerWizard::s_isVisible)
return false; return false;
bool inputAllowed = g_currentMessagePrompt.empty() && !g_currentPickerVisible && hid::IsInputAllowed(); bool noModals = g_currentMessagePrompt.empty() && !g_currentPickerVisible;
if (event->type == SDL_QUIT && g_currentPage == WizardPage::Installing) if (event->type == SDL_QUIT && g_currentPage == WizardPage::Installing)
{ {
// Pretend the back button was pressed if the user tried quitting during installation. // Pretend the back button was pressed if the user tried quitting during installation.
// This condition is above the rest of the event processing as we want to block the exit // This condition is above the rest of the event processing as we want to block the exit
// button while there's confirmation message is open as well. // button while there's confirmation message is open as well.
if (inputAllowed) if (noModals)
g_currentCursorBack = true; g_currentCursorBack = true;
return true; return true;
} }
if (!inputAllowed) if (!noModals || !hid::IsInputAllowed())
return false; return false;
constexpr float AxisValueRange = 32767.0f; constexpr float AxisValueRange = 32767.0f;