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 From 0fd96e62471a4d6c95c5c3a8d6e1de0e59c83379 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Tue, 28 Oct 2025 21:11:54 +0200 Subject: #4604 Turn off cef preloading on low end hardware 1. Cef instances are fairly heavy in viewer's implementation, don't preload them on systems <= 8GB 2. Move initialization into floaters where it belongs. 3. Minimal requirement is 8GB, drop gpu class to 1 on hardware under 8GB 4. Reduce cef instance count on systems under 8GB --- indra/newview/llviewerwindow.cpp | 45 ++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 29 deletions(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 670a3b2939..5fed98dfe4 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2322,36 +2322,23 @@ void LLViewerWindow::initWorldUI() gToolBarView->setVisible(true); } - if (!gNonInteractive) + // Don't preload cef instances on low end hardware + const F32Gigabytes MIN_PHYSICAL_MEMORY(8); + F32Gigabytes physical_mem = LLMemory::getMaxMemKB(); + if (physical_mem <= 0) { - LLMediaCtrl* destinations = LLFloaterReg::getInstance("destinations")->getChild("destination_guide_contents"); - if (destinations) - { - destinations->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); - std::string url = gSavedSettings.getString("DestinationGuideURL"); - url = LLWeb::expandURLSubstitutions(url, LLSD()); - destinations->navigateTo(url, HTTP_CONTENT_TEXT_HTML); - } - LLMediaCtrl* avatar_welcome_pack = LLFloaterReg::getInstance("avatar_welcome_pack")->findChild("avatar_picker_contents"); - if (avatar_welcome_pack) - { - avatar_welcome_pack->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); - std::string url = gSavedSettings.getString("AvatarWelcomePack"); - url = LLWeb::expandURLSubstitutions(url, LLSD()); - avatar_welcome_pack->navigateTo(url, HTTP_CONTENT_TEXT_HTML); - } - LLMediaCtrl* search = LLFloaterReg::getInstance("search")->findChild("search_contents"); - if (search) - { - search->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); - } - LLMediaCtrl* marketplace = LLFloaterReg::getInstance("marketplace")->getChild("marketplace_contents"); - if (marketplace) - { - marketplace->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); - std::string url = gSavedSettings.getString("MarketplaceURL"); - marketplace->navigateTo(url, HTTP_CONTENT_TEXT_HTML); - } + LLMemory::updateMemoryInfo(); + physical_mem = LLMemory::getMaxMemKB(); + } + + if (!gNonInteractive && physical_mem > MIN_PHYSICAL_MEMORY) + { + LL_INFOS() << "Preloading cef instances" << LL_ENDL; + + LLFloaterReg::getInstance("destinations"); + LLFloaterReg::getInstance("avatar_welcome_pack"); + LLFloaterReg::getInstance("search"); + LLFloaterReg::getInstance("marketplace"); } } -- cgit v1.2.3