summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--indra/newview/llviewerwindow.cpp35
1 files changed, 30 insertions, 5 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 8abced7e8f..22fc5ade6c 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1466,18 +1466,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)