summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Lihatskiy <118752495+marchcat@users.noreply.github.com>2026-09-17 23:52:56 +0300
committerGitHub <noreply@github.com>2026-09-17 23:52:56 +0300
commitf767219366b8dbaeea95a22bd9953a587f473298 (patch)
treea7391284f314eaf24e9684a573af7e80a0dd38ba /indra
parent9bc42804f6f574d24467ee9f56e7e67d268f0c61 (diff)
Revert #5856 OS hibernation prevention (#6340)
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llagent.cpp9
-rw-r--r--indra/newview/llappviewer.cpp42
-rw-r--r--indra/newview/llappviewer.h15
-rw-r--r--indra/newview/llappviewerlinux.cpp182
-rw-r--r--indra/newview/llappviewerlinux.h10
-rw-r--r--indra/newview/llappviewermacosx-objc.h1
-rw-r--r--indra/newview/llappviewermacosx-objc.mm66
-rw-r--r--indra/newview/llappviewermacosx.cpp7
-rw-r--r--indra/newview/llappviewermacosx.h1
-rw-r--r--indra/newview/llappviewerwin32.cpp50
-rw-r--r--indra/newview/llappviewerwin32.h1
-rw-r--r--indra/newview/llviewerwindow.cpp30
-rw-r--r--indra/newview/skins/default/xui/da/panel_preferences_setup.xml8
-rw-r--r--indra/newview/skins/default/xui/de/panel_preferences_setup.xml8
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_setup.xml37
-rw-r--r--indra/newview/skins/default/xui/es/panel_preferences_setup.xml8
-rw-r--r--indra/newview/skins/default/xui/fr/panel_preferences_setup.xml8
-rw-r--r--indra/newview/skins/default/xui/it/panel_preferences_setup.xml8
-rw-r--r--indra/newview/skins/default/xui/ja/panel_preferences_setup.xml8
-rw-r--r--indra/newview/skins/default/xui/pl/panel_preferences_setup.xml8
-rw-r--r--indra/newview/skins/default/xui/pt/panel_preferences_setup.xml8
-rw-r--r--indra/newview/skins/default/xui/pt/settings_comments.xml2
-rw-r--r--indra/newview/skins/default/xui/ru/panel_preferences_setup.xml8
-rw-r--r--indra/newview/skins/default/xui/tr/panel_preferences_setup.xml8
-rw-r--r--indra/newview/skins/default/xui/zh/panel_preferences_setup.xml8
26 files changed, 6 insertions, 546 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index f068e7fb7a..9484a35241 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -14567,17 +14567,6 @@
<key>Value</key>
<integer>180</integer>
</map>
- <key>OSHibernationMode</key>
- <map>
- <key>Comment</key>
- <string>Whether to prevent OS from hibernating. 0 - can hibernate; 1 - can't hibernate, can turn screen off; 2 - can't hibernate, can't turn screen off </string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>S32</string>
- <key>Value</key>
- <integer>0</integer>
- </map>
<key>HeightUnits</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 8d0150f228..178a14f470 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -1555,8 +1555,6 @@ void LLAgent::setAFK()
setControlFlags(AGENT_CONTROL_AWAY | AGENT_CONTROL_STOP);
gAwayTimer.start();
}
-
- LLAppViewer::instance()->setPermitOSHibernation(true);
}
//-----------------------------------------------------------------------------
@@ -1575,13 +1573,6 @@ void LLAgent::clearAFK()
sendAnimationRequest(ANIM_AGENT_AWAY, ANIM_REQUEST_STOP);
clearControlFlags(AGENT_CONTROL_AWAY);
}
-
- if (isAgentAvatarValid())
- {
- // Only set this if agent is inworld, login screen
- // shouldn't prevent hibernation.
- LLAppViewer::instance()->setPermitOSHibernation(false);
- }
}
//-----------------------------------------------------------------------------
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 139f8dd426..3e715ecf93 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -642,12 +642,6 @@ bool LLAppViewer::sendURLToOtherInstance(const std::string& url)
return false;
}
-//virtual
-void LLAppViewer::setOSHibernationMode(eHibernationMode mode)
-{
- // See OS specific files
-}
-
//----------------------------------------------------------------------------
// LLAppViewer definition
@@ -5993,30 +5987,6 @@ void LLAppViewer::outOfMemorySoftQuit()
}
}
-void LLAppViewer::setPermitOSHibernation(bool permit)
-{
- if (permit)
- {
- if (mCurrentHibernationMode != LL_HIBERNATE_MODE_DEFAULT)
- {
- // Will call OS specific code to let OS hibernate when idle
- setOSHibernationMode(LL_HIBERNATE_MODE_DEFAULT);
- mCurrentHibernationMode = LL_HIBERNATE_MODE_DEFAULT;
- }
- }
- else
- {
- // User is active, check settings and set OS hibernation mode accordingly
- static LLCachedControl<S32> os_hibernation_mode(gSavedSettings, "OSHibernationMode", 0);
- eHibernationMode mode = static_cast<eHibernationMode>(os_hibernation_mode());
- if (mCurrentHibernationMode != mode)
- {
- setOSHibernationMode(mode);
- mCurrentHibernationMode = mode;
- }
- }
-}
-
void LLAppViewer::idleNameCache()
{
// Neither old nor new name cache can function before agent has a region
@@ -6224,9 +6194,6 @@ void LLAppViewer::disconnectViewer()
// Pass the connection state to LLUrlEntryParcel not to attempt
// parcel info requests while disconnected.
LLUrlEntryParcel::setDisconnected(gDisconnected);
-
- // Restore default OS hibernation mode
- setPermitOSHibernation(true);
}
void LLAppViewer::forceErrorLLError()
@@ -6518,15 +6485,6 @@ void LLAppViewer::handleLoginComplete()
// we logged in successfully, so save settings on logout
LL_INFOS() << "Login successful, per account settings will be saved on log out." << LL_ENDL;
mSavePerAccountSettings=true;
-
- // Don't allow hibernation while we're running
- setPermitOSHibernation(false);
- // Track 'hibernation' mode changes
- mOSHibernationModeChangeConnection = gSavedSettings.getControl("OSHibernationMode")->getSignal()->connect([](LLControlVariable* control, const LLSD& new_val, const LLSD& old_val)
- {
- // setPermitOSHibernation will sort itself out based on new mode.
- LLAppViewer::instance()->setPermitOSHibernation(false);
- });
}
//virtual
diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h
index 022769b88c..54f94fe98c 100644
--- a/indra/newview/llappviewer.h
+++ b/indra/newview/llappviewer.h
@@ -270,10 +270,6 @@ public:
// Note: mQuitRequested can be aborted by user.
void outOfMemorySoftQuit();
- // If permit is true, will allow OS hibernation/sleep.
- // If false, will act based of OSHibernationMode.
- virtual void setPermitOSHibernation(bool permit);
-
#ifdef LL_DISCORD
static void initDiscordSocial();
static void updateDiscordActivity();
@@ -290,14 +286,6 @@ protected:
virtual bool initSLURLHandler();
virtual bool sendURLToOtherInstance(const std::string& url);
- typedef enum
- {
- LL_HIBERNATE_MODE_DEFAULT = 0, // Use the platform's default behavior.
- LL_HIBERNATE_MODE_PREVENT = 1,
- LL_HIBERNATE_MODE_PREVENT_SCREEN = 2,
- } eHibernationMode;
- virtual void setOSHibernationMode(eHibernationMode mode);
-
virtual bool initParseCommandLine(LLCommandLineParser& clp)
{ return true; } // Allow platforms to specify the command line args.
@@ -405,9 +393,6 @@ private:
LLAppCoreHttp mAppCoreHttp;
bool mIsFirstRun;
-
- eHibernationMode mCurrentHibernationMode = LL_HIBERNATE_MODE_DEFAULT;
- boost::signals2::scoped_connection mOSHibernationModeChangeConnection;
};
// Globals with external linkage. From viewer.h
diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp
index 2fd0eebd44..bcc9127d0e 100644
--- a/indra/newview/llappviewerlinux.cpp
+++ b/indra/newview/llappviewerlinux.cpp
@@ -79,10 +79,6 @@ namespace
void (*gOldTerminateHandler)() = NULL;
}
-// Initialize static members
-guint32 LLAppViewerLinux::sPowerInhibitCookie = 0;
-bool LLAppViewerLinux::sPowerInhibitActive = false;
-
void check_vm_bloat()
{
#if LL_LINUX
@@ -174,7 +170,6 @@ finally:
}
#endif // LL_LINUX
}
-
static void exceptionTerminateHandler()
{
// reinstall default terminate() handler in case we re-terminate.
@@ -286,11 +281,6 @@ LLAppViewerLinux::LLAppViewerLinux()
LLAppViewerLinux::~LLAppViewerLinux()
{
- // Clean up any power management inhibition on exit
- if (sPowerInhibitActive)
- {
- uninhibitPowerManagement();
- }
}
bool LLAppViewerLinux::init()
@@ -466,178 +456,6 @@ bool LLAppViewerLinux::sendURLToOtherInstance(const std::string& url)
}
#endif // LL_GLIB
-
-#if LL_GLIB
-
-namespace
-{
- // Session-bus sleep inhibitors, tried in order; both hand back a uint cookie.
- struct PowerInhibitor
- {
- const char* service;
- const char* path;
- const char* iface;
- const char* uninhibit;
- bool gnome_args;
- };
-
- const PowerInhibitor POWER_INHIBITORS[] =
- {
- { "org.freedesktop.PowerManagement", "/org/freedesktop/PowerManagement/Inhibit",
- "org.freedesktop.PowerManagement.Inhibit", "UnInhibit", false },
- { "org.gnome.SessionManager", "/org/gnome/SessionManager",
- "org.gnome.SessionManager", "Uninhibit", true }
- };
-
- const PowerInhibitor* sActiveInhibitor = nullptr;
-
- // Returns the reply, or null on failure. Takes ownership of args.
- GVariant* call_power_manager(const PowerInhibitor& inhibitor, const char* method, GVariant* args,
- const GVariantType* reply_type)
- {
- g_variant_ref_sink(args);
-
- GDBusConnection* bus = g_bus_get_sync(G_BUS_TYPE_SESSION, nullptr, nullptr);
- if (!bus)
- {
- LL_WARNS("OS") << "Getting dbus failed." << LL_ENDL;
- g_variant_unref(args);
- return nullptr;
- }
-
- GError* error = nullptr;
- GVariant* result = g_dbus_connection_call_sync(bus, inhibitor.service, inhibitor.path,
- inhibitor.iface, method, args, reply_type,
- G_DBUS_CALL_FLAGS_NONE, -1, nullptr, &error);
- if (!result)
- {
- LL_DEBUGS("OS") << inhibitor.service << "." << method << " failed: "
- << (error ? error->message : "unknown error") << LL_ENDL;
- }
- if (error)
- {
- g_error_free(error);
- }
-
- g_variant_unref(args);
- g_object_unref(bus);
- return result;
- }
-}
-
-#endif // LL_GLIB
-
-void LLAppViewerLinux::setOSHibernationMode(eHibernationMode mode)
-{
- if (mode == LL_HIBERNATE_MODE_DEFAULT)
- {
- // Allow OS to sleep/hibernate - remove any inhibition
- if (sPowerInhibitActive)
- {
- uninhibitPowerManagement();
- LL_INFOS("OS") << "Permitted OS hibernation/sleep" << LL_ENDL;
- }
- }
- else if (mode == LL_HIBERNATE_MODE_PREVENT)
- {
- // Prevent system sleep, but allow display to turn off
- // Release any existing inhibition first to allow mode switching
- if (sPowerInhibitActive)
- {
- uninhibitPowerManagement();
- }
-
- if (inhibitPowerManagement(false))
- {
- LL_INFOS("OS") << "Prevented OS hibernation/sleep, display sleep allowed" << LL_ENDL;
- }
- else
- {
- LL_WARNS("OS") << "Failed to prevent OS hibernation/sleep" << LL_ENDL;
- }
- }
- else if (mode == LL_HIBERNATE_MODE_PREVENT_SCREEN)
- {
- // Prevent both system and display sleep
- // Release any existing inhibition first to allow mode switching
- if (sPowerInhibitActive)
- {
- uninhibitPowerManagement();
- }
-
- if (inhibitPowerManagement(true))
- {
- LL_INFOS("OS") << "Prevented OS hibernation/sleep and display sleep" << LL_ENDL;
- }
- else
- {
- LL_WARNS("OS") << "Failed to prevent OS hibernation/sleep and display sleep" << LL_ENDL;
- }
- }
-}
-
-// TODO: This is AI Generated!!!, needs review and testing.
-bool LLAppViewerLinux::inhibitPowerManagement(bool inhibit_display)
-{
-#if LL_GLIB
- const char* reason = inhibit_display ?
- "Viewer active - preventing system and display sleep" :
- "Viewer active - preventing system sleep";
-
- for (const PowerInhibitor& inhibitor : POWER_INHIBITORS)
- {
- // Inhibit(app: s, reason: s) -> u, or GNOME's Inhibit(app: s, xid: u, reason: s, flags: u) -> u
- // GNOME flags: 4 = suspend, 8 = idle (display), 12 = both
- GVariant* args = inhibitor.gnome_args ?
- g_variant_new("(susu)", "SecondLifeViewer", (guint32)0, reason,
- (guint32)(inhibit_display ? 12 : 4)) :
- g_variant_new("(ss)", "Second Life Viewer", reason);
-
- GVariant* result = call_power_manager(inhibitor, "Inhibit", args, G_VARIANT_TYPE("(u)"));
- if (!result)
- {
- continue;
- }
-
- guint32 cookie = 0;
- g_variant_get(result, "(u)", &cookie);
- g_variant_unref(result);
-
- sPowerInhibitCookie = cookie;
- sPowerInhibitActive = true;
- sActiveInhibitor = &inhibitor;
- LL_INFOS("OS") << "Successfully inhibited power management using "
- << inhibitor.service << LL_ENDL;
- return true;
- }
-#endif // LL_GLIB
-
- return false;
-}
-
-void LLAppViewerLinux::uninhibitPowerManagement()
-{
-#if LL_GLIB
- if (sPowerInhibitActive && sActiveInhibitor)
- {
- GVariant* result = call_power_manager(*sActiveInhibitor, sActiveInhibitor->uninhibit,
- g_variant_new("(u)", (guint32)sPowerInhibitCookie),
- nullptr);
- if (result)
- {
- g_variant_unref(result);
- LL_INFOS("OS") << "Successfully uninhibited power management using "
- << sActiveInhibitor->service << LL_ENDL;
- }
-
- sActiveInhibitor = nullptr;
- }
-#endif // LL_GLIB
-
- sPowerInhibitCookie = 0;
- sPowerInhibitActive = false;
-}
-
void LLAppViewerLinux::initCrashReporting(bool reportFreeze)
{
}
diff --git a/indra/newview/llappviewerlinux.h b/indra/newview/llappviewerlinux.h
index faac3c0a05..6f4e087726 100644
--- a/indra/newview/llappviewerlinux.h
+++ b/indra/newview/llappviewerlinux.h
@@ -60,16 +60,6 @@ protected:
bool initSLURLHandler() override;
bool sendURLToOtherInstance(const std::string& url) override;
- void setOSHibernationMode(eHibernationMode mode) override;
-
-private:
- // Power management state tracking
- static guint32 sPowerInhibitCookie;
- static bool sPowerInhibitActive;
-
- // Helper methods for power management
- bool inhibitPowerManagement(bool inhibit_display);
- void uninhibitPowerManagement();
};
#endif // LL_LLAPPVIEWERLINUX_H
diff --git a/indra/newview/llappviewermacosx-objc.h b/indra/newview/llappviewermacosx-objc.h
index 13b8056193..bfbb48dadb 100644
--- a/indra/newview/llappviewermacosx-objc.h
+++ b/indra/newview/llappviewermacosx-objc.h
@@ -32,6 +32,5 @@
void force_ns_sxeption();
void register_url_schemes();
-void set_os_hibernation_mode(int mode);
#endif // LL_LLAPPVIEWERMACOSX_OBJC_H
diff --git a/indra/newview/llappviewermacosx-objc.mm b/indra/newview/llappviewermacosx-objc.mm
index ab4ae428b9..75d6b56e3e 100644
--- a/indra/newview/llappviewermacosx-objc.mm
+++ b/indra/newview/llappviewermacosx-objc.mm
@@ -29,7 +29,6 @@
#endif
#import <Cocoa/Cocoa.h>
-#import <IOKit/pwr_mgt/IOPMLib.h>
#include <iostream>
#include "llappviewermacosx-objc.h"
@@ -64,68 +63,3 @@ void register_url_schemes()
}
}
}
-
-// Add these as static variables at file scope
-static IOPMAssertionID gPowerAssertionID = kIOPMNullAssertionID;
-
-void set_os_hibernation_mode(int mode)
-{
- // Release existing assertion
- if (gPowerAssertionID != kIOPMNullAssertionID)
- {
- IOReturn result = IOPMAssertionRelease(gPowerAssertionID);
- if (result == kIOReturnSuccess)
- {
- gPowerAssertionID = kIOPMNullAssertionID;
- NSLog(@"Permitted OS hibernation/sleep");
- }
- else
- {
- NSLog(@"Failed to release power assertion: %d", result);
- }
- }
-
- if (mode == 1)
- {
- // Prevent OS from sleeping/hibernating
- CFStringRef assertionName = CFSTR("Second Life Viewer");
- // kIOPMAssertionTypeNoIdleSleep prevents idle sleep
- IOReturn result = IOPMAssertionCreateWithName(
- kIOPMAssertionTypeNoIdleSleep,
- kIOPMAssertionLevelOn,
- assertionName,
- &gPowerAssertionID
- );
-
- if (result == kIOReturnSuccess)
- {
- NSLog(@"Prevented OS hibernation/sleep, allow display sleep");
- }
- else
- {
- NSLog(@"Failed to create power assertion: %d", result);
- }
- }
- else if (mode == 2)
- {
- // Prevent OS from sleeping/hibernating, prevent screen from going off
- CFStringRef assertionName = CFSTR("Second Life Viewer");
- // kIOPMAssertionTypeNoIdleSleep prevents idle sleep
- // kIOPMAssertionTypeNoDisplaySleep prevents display sleep
- IOReturn result = IOPMAssertionCreateWithName(
- kIOPMAssertionTypeNoDisplaySleep,
- kIOPMAssertionLevelOn,
- assertionName,
- &gPowerAssertionID
- );
-
- if (result == kIOReturnSuccess)
- {
- NSLog(@"Prevented OS hibernation/sleep or screen from turning off");
- }
- else
- {
- NSLog(@"Failed to create power assertion: %d", result);
- }
- }
-}
diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp
index c188bb459f..f914a76fc6 100644
--- a/indra/newview/llappviewermacosx.cpp
+++ b/indra/newview/llappviewermacosx.cpp
@@ -126,7 +126,6 @@ bool pumpMainLoop()
void cleanupViewer()
{
- set_os_hibernation_mode(0); // restore default OS hibernation behavior
if(!LLApp::isError())
{
if (gViewerAppPtr)
@@ -429,12 +428,6 @@ bool LLAppViewerMacOSX::initSLURLHandler()
return true;
}
-void LLAppViewerMacOSX::setOSHibernationMode(eHibernationMode mode)
-{
- // pass to objective-c++
- set_os_hibernation_mode((int)mode);
-}
-
std::string LLAppViewerMacOSX::generateSerialNumber()
{
char serial_md5[MD5HEX_STR_SIZE]; // Flawfinder: ignore
diff --git a/indra/newview/llappviewermacosx.h b/indra/newview/llappviewermacosx.h
index 1153bd4191..35fc99dbd9 100644
--- a/indra/newview/llappviewermacosx.h
+++ b/indra/newview/llappviewermacosx.h
@@ -47,7 +47,6 @@ public:
protected:
virtual bool restoreErrorTrap();
virtual bool initSLURLHandler();
- virtual void setOSHibernationMode(eHibernationMode mode);
std::string generateSerialNumber();
virtual bool initParseCommandLine(LLCommandLineParser& clp);
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index 2080d0b7bf..f8a728a163 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -1054,56 +1054,6 @@ bool LLAppViewerWin32::sendURLToOtherInstance(const std::string& url)
return false;
}
-void LLAppViewerWin32::setOSHibernationMode(eHibernationMode mode)
-{
- // ES_CONTINUOUS tells Windows to reset the idle timer
- // and restore normal operation
- // ES_SYSTEM_REQUIRED prevents system sleep/hibernation
- // ES_DISPLAY_REQUIRED prevents display sleep
-
- if (mode == LL_HIBERNATE_MODE_DEFAULT)
- {
- // Allow OS to hibernate - clear the previous execution state flags
- // ES_CONTINUOUS without other flags allows the system to idle normally
- SetThreadExecutionState(ES_CONTINUOUS);
- LL_INFOS("OS") << "Permitted OS hibernation/sleep" << LL_ENDL;
- }
- else if (mode == LL_HIBERNATE_MODE_PREVENT)
- {
- // Prevent OS from hibernating while viewer is running
- // ES_CONTINUOUS | ES_SYSTEM_REQUIRED keeps the system awake
- EXECUTION_STATE result = SetThreadExecutionState(
- ES_CONTINUOUS | ES_SYSTEM_REQUIRED
- );
- if (result == NULL)
- {
- LL_WARNS("OS") << "Failed to prevent OS hibernation, error: " << GetLastError() << LL_ENDL;
- }
- else
- {
- LL_INFOS("OS") << "Prevented OS hibernation, but allowed display sleep" << LL_ENDL;
- }
- }
- else if (mode == LL_HIBERNATE_MODE_PREVENT_SCREEN)
- {
- // Prevent OS from hibernating or turning screen off while viewer is running
- // ES_CONTINUOUS | ES_SYSTEM_REQUIRED keeps the system awake
- // ES_DISPLAY_REQUIRED keeps the display on
- EXECUTION_STATE result = SetThreadExecutionState(
- ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED
- );
-
- if (result == NULL)
- {
- LL_WARNS("OS") << "Failed to prevent OS hibernation and display sleep, error: " << GetLastError() << LL_ENDL;
- }
- else
- {
- LL_INFOS("OS") << "Prevented OS hibernation/sleep" << LL_ENDL;
- }
- }
-}
-
bool LLAppViewerWin32::sendShutdownToOtherInstances(const std::wstring& install_dir)
{
// Velopack installs viewer like this:
diff --git a/indra/newview/llappviewerwin32.h b/indra/newview/llappviewerwin32.h
index 7c3c7a475a..971907694a 100644
--- a/indra/newview/llappviewerwin32.h
+++ b/indra/newview/llappviewerwin32.h
@@ -62,7 +62,6 @@ protected:
bool restoreErrorTrap() override;
bool sendURLToOtherInstance(const std::string& url) override;
- void setOSHibernationMode(eHibernationMode mode) override;
std::string generateSerialNumber();
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 637c03cdaa..5e06010012 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1485,30 +1485,12 @@ void LLViewerWindow::handleCloseRequestCanceled()
void LLViewerWindow::handleSuspendRequest()
{
- static LLCachedControl<S32> os_hibernation_mode(gSavedSettings, "OSHibernationMode", 0);
- if (os_hibernation_mode == 0)
- {
- LL_INFOS() << "Got a 'suspend' event from OS" << LL_ENDL;
- // Viewer doesn't handle hibernation.
- // Just send statistics.
- LLAppViewer::instance()->sendViewerStatistics(false);
- }
- else
- {
- LL_INFOS() << "Got a 'suspend' event from OS, disconnecting" << LL_ENDL;
- // Viewer is set to prevent hibernation if agent isn't away.
- // If we got here, likely Agent 'went' away then viewer got
- // a hibernation message.
- // We have a limited timeframe. Sends stats then disconnect.
- LLViewerRegion* region = gAgent.getRegion();
- if (region)
- {
- LLAppViewer::instance()->sendViewerStatistics(true);
- LLAppViewer::instance()->metricsSend(!gDisconnected);
- // Make sure to show a message.
- LLAppViewer::instance()->forceDisconnect(LLTrans::getString("YouHaveBeenDisconnected"));
- }
- }
+ LLAppViewer::instance()->sendViewerStatistics(false);
+ // Todo: this should send a disconnect request as viewer
+ // can't keep heartbeat up while suspended and will get
+ // disconnected within a minute.
+ // Add a disconnect here once 'prevent OS from sleeping'
+ // feature is ready.
}
bool LLViewerWindow::handleCloseRequest(LLWindow *window, bool from_user)
diff --git a/indra/newview/skins/default/xui/da/panel_preferences_setup.xml b/indra/newview/skins/default/xui/da/panel_preferences_setup.xml
index 981c35800f..7be9a9d555 100644
--- a/indra/newview/skins/default/xui/da/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/da/panel_preferences_setup.xml
@@ -45,12 +45,4 @@
<combo_box.item label="Installér automatisk" name="Install_automatically"/>
<combo_box.item label="Hent og installér opdateringer manuelt" name="Install_manual"/>
</combo_box>
- <text name="os_hibernation_mode">
- Forhindr OS i at gå i dvale, hvis du ikke er væk:
- </text>
- <combo_box name="os_hibernation_combobox" tool_tip="Forhindrer kun OS i at gå i dvale, hvis brugeren ikke er væk">
- <combo_box.item label="Kan gå i dvale" name="can_hibernate"/>
- <combo_box.item label="Kan ikke gå i dvale, kan slukke skærmen" name="cant_hibernate"/>
- <combo_box.item label="Kan ikke gå i dvale, kan ikke slukke skærmen" name="cant_hibernate_screen"/>
- </combo_box>
</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_preferences_setup.xml b/indra/newview/skins/default/xui/de/panel_preferences_setup.xml
index ef7ac09dba..a8509cabac 100644
--- a/indra/newview/skins/default/xui/de/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/de/panel_preferences_setup.xml
@@ -36,12 +36,4 @@
Proxy-Einstellungen:
</text>
<button label="Proxy-Einstellungen ändern" label_selected="Durchsuchen" name="set_proxy" width="160"/>
- <text name="os_hibernation_mode">
- OS-Ruhezustand verhindern, wenn nicht abwesend:
- </text>
- <combo_box name="os_hibernation_combobox" tool_tip="Verhindert den OS-Ruhezustand nur, wenn der Benutzer nicht abwesend ist">
- <combo_box.item label="Ruhezustand möglich" name="can_hibernate"/>
- <combo_box.item label="Kein Ruhezustand, Bildschirm kann ausgeschaltet werden" name="cant_hibernate"/>
- <combo_box.item label="Kein Ruhezustand, Bildschirm kann nicht ausgeschaltet werden" name="cant_hibernate_screen"/>
- </combo_box>
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
index ab4a9c9ef6..836c6094c5 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
@@ -246,41 +246,4 @@
<button.commit_callback
function="Pref.Proxy" />
</button>
- <text
- type="string"
- length="1"
- follows="left|top"
- height="10"
- layout="topleft"
- left="30"
- name="os_hibernation_mode"
- mouse_opaque="false"
- top_pad="8"
- width="300">
- When I am active (not away), my computer:
- </text>
- <combo_box
- control_name="OSHibernationMode"
- follows="left|top"
- height="23"
- layout="topleft"
- left_delta="50"
- top_pad="10"
- name="os_hibernation_combobox"
- width="300"
- tool_tip="Only prevents OS from sleeping if user is not away">
- <combo_box.item
- label="Can sleep"
- name="can_hibernate"
- value="0" />
- <combo_box.item
- label="Can't sleep but can turn off display"
- name="cant_hibernate"
- value="1" />
- <combo_box.item
- label="Can't sleep and can't turn off display"
- name="cant_hibernate_screen"
- value="2" />
- </combo_box>
</panel>
-
diff --git a/indra/newview/skins/default/xui/es/panel_preferences_setup.xml b/indra/newview/skins/default/xui/es/panel_preferences_setup.xml
index 27b3c407cf..36888850c4 100644
--- a/indra/newview/skins/default/xui/es/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/es/panel_preferences_setup.xml
@@ -36,12 +36,4 @@
Configuración de proxy:
</text>
<button label="Ajustar la configuración de proxy" label_selected="Elegir" name="set_proxy"/>
- <text name="os_hibernation_mode">
- Evitar que el sistema entre en hibernación si no está Ausente:
- </text>
- <combo_box name="os_hibernation_combobox" tool_tip="Solo evita que el sistema entre en suspensión si el usuario no está ausente">
- <combo_box.item label="Puede hibernar" name="can_hibernate"/>
- <combo_box.item label="No puede hibernar, puede apagar la pantalla" name="cant_hibernate"/>
- <combo_box.item label="No puede hibernar, no puede apagar la pantalla" name="cant_hibernate_screen"/>
- </combo_box>
</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_setup.xml b/indra/newview/skins/default/xui/fr/panel_preferences_setup.xml
index 60cbe93e6e..c010fa9e90 100644
--- a/indra/newview/skins/default/xui/fr/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/fr/panel_preferences_setup.xml
@@ -36,12 +36,4 @@
Paramètres de proxy :
</text>
<button label="Définir" label_selected="Parcourir" name="set_proxy"/>
- <text name="os_hibernation_mode">
- Empêcher l’OS d’hiberner si vous n’êtes pas absent :
- </text>
- <combo_box name="os_hibernation_combobox" tool_tip="Empêche seulement la mise en veille de l’OS si l’utilisateur n’est pas absent">
- <combo_box.item label="Peut hiberner" name="can_hibernate"/>
- <combo_box.item label="Ne peut pas hiberner, peut éteindre l’écran" name="cant_hibernate"/>
- <combo_box.item label="Ne peut pas hiberner, ne peut pas éteindre l’écran" name="cant_hibernate_screen"/>
- </combo_box>
</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_preferences_setup.xml b/indra/newview/skins/default/xui/it/panel_preferences_setup.xml
index 95ecf05617..c9d90539e1 100644
--- a/indra/newview/skins/default/xui/it/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/it/panel_preferences_setup.xml
@@ -36,12 +36,4 @@
Impostazioni proxy:
</text>
<button label="Regola impostazioni proxy" label_selected="Sfoglia" name="set_proxy" width="160"/>
- <text name="os_hibernation_mode">
- Impedisci al sistema operativo di ibernarsi se non sei Assente:
- </text>
- <combo_box name="os_hibernation_combobox" tool_tip="Impedisce al sistema operativo di andare in sospensione solo se l'utente non è assente">
- <combo_box.item label="Può ibernarsi" name="can_hibernate"/>
- <combo_box.item label="Non può ibernarsi, può spegnere lo schermo" name="cant_hibernate"/>
- <combo_box.item label="Non può ibernarsi, non può spegnere lo schermo" name="cant_hibernate_screen"/>
- </combo_box>
</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_setup.xml b/indra/newview/skins/default/xui/ja/panel_preferences_setup.xml
index 8940ca5bc9..959f827a61 100644
--- a/indra/newview/skins/default/xui/ja/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/ja/panel_preferences_setup.xml
@@ -36,12 +36,4 @@
プロキシ設定:
</text>
<button label="プロキシ設定を調整" label_selected="参照" name="set_proxy"/>
- <text name="os_hibernation_mode">
- 離席中でない場合、OS の休止状態を防止:
- </text>
- <combo_box name="os_hibernation_combobox" tool_tip="ユーザーが離席中でない場合にのみ、OS のスリープを防止します">
- <combo_box.item label="休止状態を許可" name="can_hibernate"/>
- <combo_box.item label="休止状態を禁止(画面オフは可)" name="cant_hibernate"/>
- <combo_box.item label="休止状態を禁止(画面オフも不可)" name="cant_hibernate_screen"/>
- </combo_box>
</panel>
diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_setup.xml b/indra/newview/skins/default/xui/pl/panel_preferences_setup.xml
index 7147f024cb..bd36f10509 100644
--- a/indra/newview/skins/default/xui/pl/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/pl/panel_preferences_setup.xml
@@ -33,12 +33,4 @@
Ustawienia proxy:
</text>
<button label="Dostosuj ustawienia" label_selected="Przeglądaj" name="set_proxy" />
- <text name="os_hibernation_mode">
- Zapobiegaj hibernacji systemu, gdy użytkownik nie jest AFK:
- </text>
- <combo_box name="os_hibernation_combobox" tool_tip="Zapobiega usypianiu systemu tylko wtedy, gdy użytkownik nie jest AFK">
- <combo_box.item label="Może hibernować" name="can_hibernate"/>
- <combo_box.item label="Nie może hibernować, może wyłączyć ekran" name="cant_hibernate"/>
- <combo_box.item label="Nie może hibernować, nie może wyłączyć ekranu" name="cant_hibernate_screen"/>
- </combo_box>
</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml b/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml
index 101f58488d..56fc225bc0 100644
--- a/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml
@@ -36,12 +36,4 @@
Configurações de proxy:
</text>
<button label="Ajustar configurações de proxy" label_selected="Procurar" name="set_proxy" width="180"/>
- <text name="os_hibernation_mode">
- Impedir que o sistema entre em hibernação se não estiver Ausente:
- </text>
- <combo_box name="os_hibernation_combobox" tool_tip="Só impede que o sistema entre em suspensão se o utilizador não estiver ausente">
- <combo_box.item label="Pode hibernar" name="can_hibernate"/>
- <combo_box.item label="Não pode hibernar, pode desligar o ecrã" name="cant_hibernate"/>
- <combo_box.item label="Não pode hibernar, não pode desligar o ecrã" name="cant_hibernate_screen"/>
- </combo_box>
</panel>
diff --git a/indra/newview/skins/default/xui/pt/settings_comments.xml b/indra/newview/skins/default/xui/pt/settings_comments.xml
index 22f6487847..63d68a3f5b 100644
--- a/indra/newview/skins/default/xui/pt/settings_comments.xml
+++ b/indra/newview/skins/default/xui/pt/settings_comments.xml
@@ -1435,8 +1435,6 @@
<string>Número de logins bem-sucedidos no Second Life.</string>
<key>NvAPICreateApplicationProfile</key>
<string>Criar perfil de aplicativo NVIDIA para configurações otimizadas.</string>
- <key>OSHibernationMode</key>
- <string>Se deve impedir que o SO hiberne. 0 - pode hibernar; 1 - não pode hibernar, pode desligar a tela; 2 - não pode hibernar, não pode desligar a tela.</string>
<key>ObjectCacheEnabled</key>
<string>Ativar o cache de objetos.</string>
<key>ObjectCostHighColor</key>
diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml b/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml
index cec72ebe21..137e047d97 100644
--- a/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml
@@ -36,12 +36,4 @@
Настройки прокси-сервера:
</text>
<button label="Задать настройки" label_selected="Обзор" name="set_proxy"/>
- <text name="os_hibernation_mode">
- Предотвращать гибернацию ОС, если пользователь не отошел:
- </text>
- <combo_box name="os_hibernation_combobox" tool_tip="Предотвращает переход ОС в сон, только если пользователь не отошел">
- <combo_box.item label="Гибернация разрешена" name="can_hibernate"/>
- <combo_box.item label="Гибернация запрещена, экран можно выключать" name="cant_hibernate"/>
- <combo_box.item label="Гибернация запрещена, экран нельзя выключать" name="cant_hibernate_screen"/>
- </combo_box>
</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_setup.xml b/indra/newview/skins/default/xui/tr/panel_preferences_setup.xml
index a3d99ac01f..a20d0e5ff1 100644
--- a/indra/newview/skins/default/xui/tr/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/tr/panel_preferences_setup.xml
@@ -36,12 +36,4 @@
Proxy Ayarları:
</text>
<button label="Proxy ayarlarını yap" label_selected="Gözat" name="set_proxy"/>
- <text name="os_hibernation_mode">
- Uzakta değilse işletim sisteminin hazırda beklemesini engelle:
- </text>
- <combo_box name="os_hibernation_combobox" tool_tip="Yalnızca kullanıcı uzakta değilse işletim sisteminin uykuya geçmesini engeller">
- <combo_box.item label="Hazırda bekleyebilir" name="can_hibernate"/>
- <combo_box.item label="Hazırda bekleyemez, ekran kapanabilir" name="cant_hibernate"/>
- <combo_box.item label="Hazırda bekleyemez, ekran kapanamaz" name="cant_hibernate_screen"/>
- </combo_box>
</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_preferences_setup.xml b/indra/newview/skins/default/xui/zh/panel_preferences_setup.xml
index c83a7512e0..6ef25ad96e 100644
--- a/indra/newview/skins/default/xui/zh/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/zh/panel_preferences_setup.xml
@@ -36,12 +36,4 @@
代理伺服器設定:
</text>
<button label="調整代理伺服器設定" label_selected="瀏覽" name="set_proxy"/>
- <text name="os_hibernation_mode">
- 不處於離開狀態時阻止作業系統休眠:
- </text>
- <combo_box name="os_hibernation_combobox" tool_tip="僅在使用者不處於離開狀態時阻止作業系統睡眠">
- <combo_box.item label="可休眠" name="can_hibernate"/>
- <combo_box.item label="不可休眠,可關閉螢幕" name="cant_hibernate"/>
- <combo_box.item label="不可休眠,不可關閉螢幕" name="cant_hibernate_screen"/>
- </combo_box>
</panel>