summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-04-29 01:20:11 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-05-01 00:36:27 +0300
commite129eac3401f6af629ef96e91f4db62b3528cbc9 (patch)
treef394a138b9e37841fc1707488797e34502a7b798 /indra/newview/llviewerwindow.cpp
parent998c2bc8d924fe9179f4ee914ef2b65c6ae78302 (diff)
#5719 Partial detection of shutdown from task manager
We can't be absolutely certain about the source in this case, but at least try to distinguish termination caused by task manager from 'unknowns'.
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--indra/newview/llviewerwindow.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 8695b96952..369a887102 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -38,6 +38,7 @@
#include "llagent.h"
#include "llagentcamera.h"
+#include "llcallbacklist.h"
#include "llcommandhandler.h"
#include "llcommunicationchannel.h"
#include "llfloaterreg.h"
@@ -1466,12 +1467,32 @@ void LLViewerWindow::handleMouseLeave(LLWindow *window)
LLToolTipMgr::instance().blockToolTips();
}
+void LLViewerWindow::handlePreCloseRequest()
+{
+ // WINDOW THREAD! since we need this to act fast.
+ if (!LLApp::isExiting() && !LLApp::isStopped())
+ {
+ LLAppViewer::instance()->createCloseRequestMarker();
+ }
+
+}
+
bool LLViewerWindow::handleCloseRequest(LLWindow *window, bool from_user)
{
if (!LLApp::isExiting() && !LLApp::isStopped())
{
if (from_user)
{
+ // Task naamger kills viewer after 1 second, 3 seconds
+ // is overkill, but decided to be on a safe side.
+ doAfterInterval([]()
+ {
+ // if user quits, marker will be cleaned by cleanup,
+ // if user cancels quit, marker will be cleaned here,
+ // but if task manager kills us, marker stays.
+ LLAppViewer::instance()->removeCloseRequestMarker();
+ }, 3.0f);
+
// User has indicated they want to close, but we may need to ask
// about modified documents.
LLAppViewer::instance()->userQuit();