From c166631e691531630ed9eb8996e1bfdf0da1be50 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 22 Oct 2026 14:48:41 +0300 Subject: #6433 Update comments after changing StopMicCaptureWhenMuted default value --- indra/llwebrtc/llwebrtc.cpp | 24 ++++++++++++------------ indra/newview/app_settings/settings.xml | 2 +- indra/newview/llvoicewebrtc.cpp | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index ae1980234c..e0b9613f40 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -639,11 +639,11 @@ void LLWebRTCImpl::unsetDevicesObserver(LLWebRTCDevicesObserver *observer) } // must be run in the worker thread. Selects the configured capture device and -// starts recording. By default capture runs the whole time voice is enabled -// (never stopped for mute or between calls, so the AEC never cold-starts -- no -// hiss on unmute), so this is a no-op when already recording. With "stop capture -// while muted" it's only started while unmuted and once a connection's audio is -// established. Device changes go through workerDeployDevices(), which stops +// starts recording. By default capture only runs while unmuted and once a +// connection's audio is established. With "stop capture while muted" disabled, +// capture runs the whole time voice is enabled (never stopped for mute or between +// calls, so the AEC never cold-starts -- no hiss on unmute), so this is a no-op +// when already recording. Device changes go through workerDeployDevices(), which stops // recording first to force a clean re-select; voice off goes through setVoiceEnabled(false). void LLWebRTCImpl::workerStartRecording() { @@ -841,8 +841,8 @@ void LLWebRTCImpl::setVoiceEnabled(bool enable) } if (enable) { - // Voice on: start the capture device (by default it then stays - // running across calls and mute/unmute), and start playout if + // Voice on: start the capture device (with "stop capture while muted" disabled + // it then stays running across calls and mute/unmute), and start playout if // there's already a connection to render. mDeviceModule->Init(); workerDeployDevices(); @@ -1047,11 +1047,11 @@ void LLWebRTCImpl::setMute(bool mute, int delay_ms) void LLWebRTCImpl::intSetMute(bool mute, int delay_ms) { // Mute by zeroing the captured (post-APM) gain; the sender track is also - // disabled per connection (see LLWebRTCPeerConnectionImpl::setMute). By - // default the capture device stays running for the whole session, so - // muting/unmuting never stops or starts it -- that's what avoids the AEC - // cold-start hiss on unmute. With "stop capture while muted", it's stopped - // after the mute delay and restarted on unmute (below). + // disabled per connection (see LLWebRTCPeerConnectionImpl::setMute). By + // default the capture device stops after the mute delay and restarts on + // unmute. With "stop capture while muted" disabled, it stays running for + // the whole session, so muting/unmuting never stops or starts it -- that's + // what avoids the AEC cold-start hiss on unmute. if (mPeerCustomProcessor) { mPeerCustomProcessor->setGain(mMute ? 0.0f : mGain); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c3c59a3e29..799710177e 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -16799,7 +16799,7 @@ Persist 1 Type - Boolean + S32 Value 1 diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index cd5a15e891..0f0f4b5735 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -324,11 +324,11 @@ void LLWebRTCVoiceClient::initWebRTC() { if (mWebRTCDeviceInterface) { - mWebRTCDeviceInterface->setStopCaptureOnMute(new_val.asBoolean()); + mWebRTCDeviceInterface->setStopCaptureOnMute(new_val.asInteger()); } }); } - mWebRTCDeviceInterface->setStopCaptureOnMute(gSavedSettings.getBOOL("StopMicCaptureWhenMuted")); + mWebRTCDeviceInterface->setStopCaptureOnMute(gSavedSettings.getS32("StopMicCaptureWhenMuted")); refreshDeviceLists(); } @@ -1757,7 +1757,7 @@ void LLWebRTCVoiceClient::setMuteMic(bool muted) mMuteMic = muted; - if (mIsInTuningMode &&!gSavedSettings.getBOOL("StopMicCaptureWhenMuted")) + if (mIsInTuningMode &&!gSavedSettings.getS32("StopMicCaptureWhenMuted")) { return; } -- cgit v1.3 From ef5f54bbf3ab41980d9cf3be273257927a6a6cbb Mon Sep 17 00:00:00 2001 From: Kyler Eastridge Date: Wed, 21 Oct 2026 22:32:09 -0400 Subject: #6322 Fix nulls in clipboard truncating string --- indra/llui/llclipboard.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index 64896ccfcb..0483da001f 100644 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -132,6 +132,11 @@ bool LLClipboard::addToClipboard(const LLWString &src, S32 pos, S32 len, bool us LL_WARNS() << "Can't add the substring to clipboard: " << e.what() << LL_ENDL; return false; } + + // Clipboards cannot contain NULL characters, so remove them first so they + // do not truncate the string. + mString.erase(std::remove(mString.begin(), mString.end(), 0), mString.end()); + return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString)); } -- cgit v1.3 From d99f006e3f00e8031c831653ca1679fba40921c9 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 22 Oct 2026 23:24:21 +0300 Subject: #6495 fix attachments showing in mouselook when FirstPersonAvatarVisible is disabled --- indra/newview/llagent.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index c628e89a36..97bf6e98be 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -2505,6 +2505,11 @@ void LLAgent::endAnimationUpdateUI() LLFloaterCamera::onAvatarEditingAppearance(true); } + // Sync before updating attachment visibility + // Don't let this be called more than once if the camera + // mode hasn't changed. --JC + gAgentCamera.updateLastCamera(); + if (isAgentAvatarValid()) { gAgentAvatarp->updateAttachmentVisibility(gAgentCamera.getCameraMode()); @@ -2514,10 +2519,6 @@ void LLAgent::endAnimationUpdateUI() { gFloaterTools->dirty(); } - - // Don't let this be called more than once if the camera - // mode hasn't changed. --JC - gAgentCamera.updateLastCamera(); } boost::signals2::connection LLAgent::setMouselookModeInCallback( const camera_signal_t::slot_type& cb ) -- cgit v1.3 From ff5d161f335065ff94dfc39a36cf0f53cbaab15b Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Thu, 22 Oct 2026 17:14:31 +0300 Subject: #6481 Keep macOS buffer swaps tied to the Cocoa context owner --- indra/llwindow/llopenglview-objc.mm | 1 + indra/llwindow/llwindowmacosx-objc.h | 2 +- indra/llwindow/llwindowmacosx-objc.mm | 4 ++-- indra/llwindow/llwindowmacosx.cpp | 23 +++++++++-------------- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 6b5a457305..9ecce4ce7e 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -318,6 +318,7 @@ attributedStringInfo getSegments(NSAttributedString *str) [glContext setValues:&swapInterval forParameter:NSOpenGLContextParameterSwapInterval]; } + [glContext release]; // setOpenGLContext: retains the context for the view. return self; } diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index e3a1253c1f..a22492c338 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -108,7 +108,7 @@ NSWindowRef createNSWindow(int x, int y, int width, int height); #include GLViewRef createOpenGLView(NSWindowRef window, unsigned int samples, bool vsync); -void glSwapBuffers(void* context); +void glSwapBuffers(GLViewRef view); CGLContextObj getCGLContextObj(GLViewRef view); unsigned long getVramSize(GLViewRef view); float getDeviceUnitSize(GLViewRef view); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index d902a82a3c..f61d9a0321 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -238,9 +238,9 @@ GLViewRef createOpenGLView(NSWindowRef window, unsigned int samples, bool vsync) return glview; } -void glSwapBuffers(void* context) +void glSwapBuffers(GLViewRef view) { - [(NSOpenGLContext*)context flushBuffer]; + [[(LLOpenGLView*)view openGLContext] flushBuffer]; } CGLContextObj getCGLContextObj(GLViewRef view) diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index ae337d9906..a5cf387ad2 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -873,15 +873,12 @@ void LLWindowMacOSX::destroyContext() // We don't have a context return; } - // Unhook the GL context from any drawable it may have - if(mContext != NULL) - { - LL_DEBUGS("Window") << "destroyContext: unhooking drawable " << LL_ENDL; - CGLSetCurrentContext(NULL); - } - // Clean up remaining GL state before blowing away window + CGLSetCurrentContext(mContext); gGLManager.shutdownGL(); + CGLSetCurrentContext(NULL); + // The Cocoa view owns this context and releases it in removeGLView(). + mContext = NULL; // Clean up the pixel format if(mPixelFormat != NULL) @@ -890,12 +887,6 @@ void LLWindowMacOSX::destroyContext() mPixelFormat = NULL; } - // Clean up the GL context - if(mContext != NULL) - { - CGLDestroyContext(mContext); - } - // Destroy our LLOpenGLView if(mGLView != NULL) { @@ -1136,7 +1127,11 @@ bool LLWindowMacOSX::setSizeImpl(const LLCoordWindow size) void LLWindowMacOSX::swapBuffers() { - CGLFlushDrawable(mContext); + if (mContext) + { + llassert(mGLView && getCGLContextObj(mGLView) == mContext); + glSwapBuffers(mGLView); + } } void LLWindowMacOSX::restoreGLContext() -- cgit v1.3 From cb5dd9181198cab5fadc71fa548201af0234128f Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Thu, 22 Oct 2026 17:05:17 +0300 Subject: #6442 Restore the macOS render context before each frame --- indra/llwindow/llwindowmacosx.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index a5cf387ad2..7f0c632b25 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1006,6 +1006,8 @@ void LLWindowMacOSX::gatherInput(bool app_has_focus) { updateCursor(); LLGameControl::processEvents(app_has_focus); + // Cocoa event handling can change the current context between frames. + restoreGLContext(); } bool LLWindowMacOSX::getPosition(LLCoordScreen *position) const @@ -1137,6 +1139,7 @@ void LLWindowMacOSX::swapBuffers() void LLWindowMacOSX::restoreGLContext() { CGLSetCurrentContext(mContext); + llassert(CGLGetCurrentContext() == mContext); } F32 LLWindowMacOSX::getGamma() const -- cgit v1.3