Merge commit '7947ce3' into marchcat/maint-c/maint-c-restore

# Conflicts:
#	indra/newview/llappviewer.cpp
master
Andrey Lihatskiy 2025-04-10 01:05:12 +03:00
commit 2813097aff
4 changed files with 46 additions and 8 deletions

View File

@ -91,7 +91,7 @@
<key>Type</key>
<string>S32</string>
<key>Value</key>
<real>300.0</real>
<real>300</real>
</map>
<key>AckCollectTime</key>
<map>

View File

@ -449,11 +449,20 @@ void idle_afk_check()
{
// check idle timers
F32 current_idle = gAwayTriggerTimer.getElapsedTimeF32();
F32 afk_timeout = (F32)gSavedSettings.getS32("AFKTimeout");
if (afk_timeout && (current_idle > afk_timeout) && ! gAgent.getAFK())
LLCachedControl<S32> afk_timeout(gSavedSettings, "AFKTimeout", 300);
if (afk_timeout() && (current_idle > afk_timeout()))
{
LL_INFOS("IdleAway") << "Idle more than " << afk_timeout << " seconds: automatically changing to Away status" << LL_ENDL;
gAgent.setAFK();
if (!gAgent.getAFK())
{
LL_INFOS("IdleAway") << "Idle more than " << afk_timeout << " seconds: automatically changing to Away status" << LL_ENDL;
gAgent.setAFK();
}
else
{
// Refresh timer so that random one click or hover won't clear the status.
// But expanding the window still should lift afk status
gAwayTimer.reset();
}
}
}

View File

@ -881,6 +881,10 @@ void LLViewerJoystick::moveObjects(bool reset)
{
gAgent.clearAFK();
}
else
{
gAwayTriggerTimer.reset();
}
if (sDelta[0] || sDelta[1] || sDelta[2])
{
@ -1055,6 +1059,10 @@ void LLViewerJoystick::moveAvatar(bool reset)
{
gAgent.clearAFK();
}
else
{
gAwayTriggerTimer.reset();
}
setCameraNeedsUpdate(true);
}
@ -1267,10 +1275,17 @@ void LLViewerJoystick::moveFlycam(bool reset)
}
// Clear AFK state if moved beyond the deadzone
if (!is_zero && gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
if (!is_zero)
{
if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
{
gAgent.clearAFK();
}
else
{
gAwayTriggerTimer.reset();
}
}
sFlycamPosition += LLVector3(sDelta) * sFlycamRotation;
@ -1331,6 +1346,10 @@ bool LLViewerJoystick::toggleFlycam()
{
gAgent.clearAFK();
}
else
{
gAwayTriggerTimer.reset();
}
mOverrideCamera = !mOverrideCamera;
if (mOverrideCamera)

View File

@ -1425,11 +1425,17 @@ void LLViewerWindow::handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask
mWindow->showCursorFromMouseMove();
if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME
&& !gDisconnected)
if (!gDisconnected)
{
if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
{
gAgent.clearAFK();
}
else
{
gAwayTriggerTimer.reset();
}
}
}
void LLViewerWindow::handleMouseDragged(LLWindow *window, LLCoordGL pos, MASK mask)
@ -1545,6 +1551,10 @@ bool LLViewerWindow::handleTranslatedKeyDown(KEY key, MASK mask, bool repeated)
{
gAgent.clearAFK();
}
else
{
gAwayTriggerTimer.reset();
}
// *NOTE: We want to interpret KEY_RETURN later when it arrives as
// a Unicode char, not as a keydown. Otherwise when client frame