diff options
| author | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-09-11 20:38:09 +0300 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-09-12 23:32:51 +0300 |
| commit | 8eb015666e0224574013d1338ddaf70a19355e5e (patch) | |
| tree | df3c1f462af67d1c0e9a600bbfd91a3370873c20 /indra/newview/llviewerwindow.cpp | |
| parent | ac2cbdcc02efb8af88d91f02ec1b58022e4bf439 (diff) | |
#4651 Handle window's sessions termination
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
| -rw-r--r-- | indra/newview/llviewerwindow.cpp | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 0edb7c70ea..42ad82d731 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1461,18 +1461,43 @@ void LLViewerWindow::handleMouseLeave(LLWindow *window) LLToolTipMgr::instance().blockToolTips(); } -bool LLViewerWindow::handleCloseRequest(LLWindow *window) +bool LLViewerWindow::handleCloseRequest(LLWindow *window, bool from_user) { if (!LLApp::isExiting() && !LLApp::isStopped()) { - // User has indicated they want to close, but we may need to ask - // about modified documents. - LLAppViewer::instance()->userQuit(); - // Don't quit immediately + if (from_user) + { + // User has indicated they want to close, but we may need to ask + // about modified documents. + LLAppViewer::instance()->userQuit(); + // Don't quit immediately + } + else + { + // OS is asking us to quit, assume we have time and start cleanup + LLAppViewer::instance()->requestQuit(); + } } return false; } +bool LLViewerWindow::handleSessionExit(LLWindow* window) +{ + if (!LLApp::isExiting() && !LLApp::isStopped()) + { + // Viewer received WM_ENDSESSION and app will be killed soon if it doesn't respond + LLAppViewer* app = LLAppViewer::instance(); + app->sendSimpleLogoutRequest(); + app->earlyExitNoNotify(); + + // Not viewer's fault, remove marker files so + // that statistics won't consider this to be a crash + app->removeMarkerFiles(); + return false; + } + return true; +} + void LLViewerWindow::handleQuit(LLWindow *window) { if (gNonInteractive) |
