From 8eb015666e0224574013d1338ddaf70a19355e5e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Thu, 11 Sep 2025 20:38:09 +0300 Subject: #4651 Handle window's sessions termination --- indra/newview/llviewerwindow.cpp | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'indra/newview/llviewerwindow.cpp') 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) -- cgit v1.2.3 From 6fc138dc44b963254a9c26562f5ef50256fb6f1d Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Wed, 8 Oct 2025 22:25:31 +0300 Subject: p#351 Mark RenderMaxOpenGLVersion as Windows specific --- indra/newview/llviewerwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 22fc5ade6c..3849c286c5 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1922,7 +1922,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) p.ignore_pixel_depth, 0, max_core_count, - max_gl_version); //don't use window level anti-aliasing + max_gl_version); //don't use window level anti-aliasing, windows only if (NULL == mWindow) { -- cgit v1.2.3 From 38257221d090a8c2669d34a23891e7b66153df6f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 13 Nov 2024 00:11:53 +0200 Subject: viewer#3018 Expose mouse wrap in UI And attempt some basic automation --- indra/newview/llviewerwindow.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 3849c286c5..670a3b2939 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3340,7 +3340,31 @@ void LLViewerWindow::clearPopups() void LLViewerWindow::moveCursorToCenter() { - if (! gSavedSettings.getBOOL("DisableMouseWarp")) + bool mouse_warp = false; + LLCachedControl mouse_warp_mode(gSavedSettings, "MouseWarpMode", 1); + + switch (mouse_warp_mode()) + { + case 0: + // For Windows: + // Mouse usually uses 'delta' position since it isn't aware of own location, keep it centered. + // Touch screen reports absolute or virtual absolute position and warping a physical + // touch is pointless, so don't move it. + // + // MacOS + // If 'decoupled', CGAssociateMouseAndMouseCursorPosition can make mouse stay in + // one place and not move, do not move it (needs testing). + mouse_warp = mWindow->isWrapMouse(); + break; + case 1: + mouse_warp = true; + break; + default: + mouse_warp = false; + break; + } + + if (mouse_warp) { S32 x = getWorldViewWidthScaled() / 2; S32 y = getWorldViewHeightScaled() / 2; -- cgit v1.2.3