summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowwin32.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2025-12-01 17:27:19 +0200
committerMnikolenko Productengine <mnikolenko@productengine.com>2025-12-01 17:27:44 +0200
commit1565e460830f9e3d9e4cd4d82977df6c17eb3112 (patch)
tree74c3f90d2d0129f7d5e58805e15ed3480b241063 /indra/llwindow/llwindowwin32.cpp
parenta9e8676611bf0ffda077a6d7561e0d57f9e3fcf7 (diff)
parent906c58ac3821ce364096b7c7f2df80b67d9740b6 (diff)
Merge branch 'develop' into maxim/voice-moderation
Diffstat (limited to 'indra/llwindow/llwindowwin32.cpp')
-rw-r--r--indra/llwindow/llwindowwin32.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 824d0f5ec6..f826a60ddd 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -2502,16 +2502,13 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
// Comes after WM_QUERYENDSESSION
LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32("mwp - WM_ENDSESSION");
LL_INFOS("Window") << "Received WM_ENDSESSION with wParam: " << (U32)w_param << " lParam: " << (U32)l_param << LL_ENDL;
- unsigned int end_session_flags = (U32)w_param;
- if (end_session_flags == 0)
- {
- // session is not actually ending
- return 0;
- }
+ unsigned int end_session_flags = (U32)l_param;
- if ((end_session_flags & ENDSESSION_CLOSEAPP)
- || (end_session_flags & ENDSESSION_CRITICAL)
- || (end_session_flags & ENDSESSION_LOGOFF))
+ if (w_param == TRUE // if true, session is ending
+ || end_session_flags == 0 // not possible to determine type of the event
+ // || (end_session_flags & ENDSESSION_CLOSEAPP)) system update or low resources, must be acompanied by w_param == TRUE
+ || (end_session_flags & ENDSESSION_CRITICAL) // will shutdown regardless of app state
+ || (end_session_flags & ENDSESSION_LOGOFF)) // logoff, can delay shutdown
{
window_imp->post([=]()
{
@@ -2520,13 +2517,13 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
{
// Get the app to initiate cleanup.
window_imp->mCallbacks->handleQuit(window_imp);
- // The app is responsible for calling destroyWindow when done with GL
}
});
// Give app a second to finish up. That's not enough for a clean exit,
// but better than nothing.
// Todo: sync this better, some kind of waitForResult? Can't wait forever,
- // but can potentially use ShutdownBlockReasonCreate for a bigger delay.
+ // but for ENDSESSION_LOGOFF can potentially use ShutdownBlockReasonCreate
+ // for a bigger delay.
ms_sleep(1000);
}
// Don't need to post quit or destroy window,