From 1b1a490bb25761b43a390b86c2a9409972782cfb Mon Sep 17 00:00:00 2001 From: Beq Date: Sun, 23 Jul 2023 20:03:35 +0100 Subject: [PATCH 1/5] Avoid possible (but not really possible) overrun that annoys gcc --- indra/newview/rlvhandler.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index beebf94dc5..c8ddff884f 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -481,6 +481,13 @@ ERlvCmdRet RlvHandler::processCommand(std::reference_wrapper r case RLV_TYPE_ADD: // Checked: 2009-11-26 (RLVa-1.1.0f) | Modified: RLVa-1.1.0f { ERlvBehaviour eBhvr = rlvCmd.get().getBehaviourType(); + if(eBhvr == RLV_BHVR_UNKNOWN) + { + eRet = RLV_RET_FAILED_PARAM; + RLV_DEBUGS << "\t- " << rlvCmd.get().getBehaviour() << " is UNKNOWN => Call Kitty!" << RLV_ENDL; + break; + } + if ( (m_Behaviours[eBhvr]) && ( (RLV_BHVR_SETCAM == eBhvr) || (RLV_BHVR_SETDEBUG == eBhvr) || (RLV_BHVR_SETENV == eBhvr) ) ) { // Some restrictions can only be held by one single object to avoid deadlocks From a9882934c16ab861360275fb0967a3b56568d5eb Mon Sep 17 00:00:00 2001 From: Beq Date: Sun, 23 Jul 2023 21:01:00 +0100 Subject: [PATCH 2/5] [FIRE-32943] - Tentative fix for allow double click on scripted objects. --- indra/newview/lltoolpie.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index a6f50059c8..f632c09d78 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -1016,14 +1016,22 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask) } // FIRE-1765: Allow double-click walk/teleport to scripted objects + // modified for FIRE-32943 by Beq //if (!mDoubleClickTimer.getStarted() || (mDoubleClickTimer.getElapsedTimeF32() > 0.3f)) + // { + // mDoubleClickTimer.stop(); + // return FALSE; + // } + bool canDoubleClickTP = gSavedSettings.getBOOL("DoubleClickTeleport"); bool allowDoubleClickOnScriptedObjects = gSavedSettings.getBOOL("FSAllowDoubleClickOnScriptedObjects"); - if (!allowDoubleClickOnScriptedObjects && (!mDoubleClickTimer.getStarted() || (mDoubleClickTimer.getElapsedTimeF32() > 0.3f))) - // + if ( canDoubleClickTP && allowDoubleClickOnScriptedObjects ) { mDoubleClickTimer.stop(); - return FALSE; + teleportToClickedLocation(); + return TRUE; } + // + mDoubleClickTimer.stop(); return FALSE; From 186a433819b25b3373efd2aafea99a875c4d27af Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 24 Jul 2023 21:31:05 +0200 Subject: [PATCH 3/5] Use new method for setting up control value changed signal listener --- indra/newview/llviewercontrol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index b535fe2f6c..eabcce5d50 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -1485,7 +1485,7 @@ void settings_setup_listeners() // Handle IME text input getting enabled or disabled #if LL_SDL2 - gSavedSettings.getControl("SDL2IMEEnabled")->getSignal()->connect(boost::bind(&handleSDL2IMEEnabledChanged, _2)); + setting_setup_signal_listener(gSavedSettings, "SDL2IMEEnabled", handleSDL2IMEEnabledChanged); #endif // } From 693c12c53f2c1bb636a835058aaf54f1c8bf807f Mon Sep 17 00:00:00 2001 From: Beq Date: Wed, 26 Jul 2023 13:56:52 +0100 Subject: [PATCH 4/5] Pointer caching is unsafe, let's use UUID lookup instead --- indra/newview/fsareasearch.cpp | 7 ++++--- indra/newview/llfloater360capture.cpp | 8 +++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/indra/newview/fsareasearch.cpp b/indra/newview/fsareasearch.cpp index e1cf90b490..1e76d27428 100644 --- a/indra/newview/fsareasearch.cpp +++ b/indra/newview/fsareasearch.cpp @@ -343,7 +343,8 @@ void FSAreaSearch::updateRlvRestrictions(ERlvBehaviour behavior) void FSAreaSearch::checkRegion() { - static LLViewerRegion *last_region = nullptr; + static LLUUID last_region_id = LLUUID::null; + auto last_region = LLWorld::instance().getRegionFromID(last_region_id); // Check if we changed region, if so reset the interest list to full, LLViewerRegion* region = gAgent.getRegion(); if( region && (region != last_region) ) @@ -359,7 +360,7 @@ void FSAreaSearch::checkRegion() if( std::find( uniqueRegions.begin(), uniqueRegions.end(), last_region ) != uniqueRegions.end() ) { // Crossed into a neighboring region, no need to clear everything. - last_region = region; + last_region_id = region->getRegionID(); return; } // else teleported into a new region @@ -380,7 +381,7 @@ void FSAreaSearch::checkRegion() last_region->clearFullUpdateInterestList(); } } - last_region = region; + last_region_id = region->getRegionID(); } void FSAreaSearch::refreshList(bool cache_clear) diff --git a/indra/newview/llfloater360capture.cpp b/indra/newview/llfloater360capture.cpp index 975beca295..98be1570d3 100644 --- a/indra/newview/llfloater360capture.cpp +++ b/indra/newview/llfloater360capture.cpp @@ -48,13 +48,15 @@ #include "llviewerregion.h" #include "llviewerwindow.h" #include "pipeline.h" - +#include "llworld.h" // needed for getRegionByID(); #include // Fix 360 capture missing objects after TP void LLFloater360Capture::checkRegion() { - static LLViewerRegion *last_region = nullptr; + static LLUUID last_region_id = LLUUID::null; + auto last_region = LLWorld::instance().getRegionFromID(last_region_id); + // Check if we changed region, if so reset the interest list to full, LLViewerRegion* region = gAgent.getRegion(); if( region && (region != last_region) ) @@ -67,7 +69,7 @@ void LLFloater360Capture::checkRegion() last_region->clearFullUpdateInterestList(); } } - last_region = region; + last_region_id = region->getRegionID(); } // From 64e2a68c56caf85f5939def70ad2602830284a0c Mon Sep 17 00:00:00 2001 From: Zi Ree Date: Thu, 27 Jul 2023 13:48:36 +0200 Subject: [PATCH 5/5] Fix closing floater not erroneously closing all other same-type floaters when tapping shift inside a floater a couple of times before closing the floater with the X and no shift pressed --- indra/llui/llfloater.cpp | 29 ++--------------------------- indra/llui/llfloater.h | 8 -------- 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 9f5bb25e3f..f44910fdca 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -291,8 +291,7 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) mDefaultRelativeX(p.rel_x), mDefaultRelativeY(p.rel_y), mMinimizeSignal(NULL), - mHostedFloaterShowtitlebar(p.hosted_floater_show_titlebar), // MultiFloater without titlebar for hosted floater - mShiftPressed(false) // FIRE-24125: Add option to close all floaters of a group + mHostedFloaterShowtitlebar(p.hosted_floater_show_titlebar) // MultiFloater without titlebar for hosted floater // mNotificationContext(NULL) { mPosition.setFloater(*this); @@ -1720,30 +1719,6 @@ BOOL LLFloater::handleDoubleClick(S32 x, S32 y, MASK mask) return was_minimized || LLPanel::handleDoubleClick(x, y, mask); } -// FIRE-24125: Add option to close all floaters of a group -//virtual -BOOL LLFloater::handleKeyHere(KEY key, MASK mask) -{ - if (mask == MASK_SHIFT) - { - mShiftPressed = true; - } - - return LLPanel::handleKeyHere(key, mask); -} - -//virtual -BOOL LLFloater::handleKeyUpHere(KEY key, MASK mask) -{ - if (mask == MASK_SHIFT) - { - mShiftPressed = false; - } - - return LLPanel::handleKeyUpHere(key, mask); -} -// - void LLFloater::bringToFront( S32 x, S32 y ) { if (getVisible() && pointInView(x, y)) @@ -1993,7 +1968,7 @@ void LLFloater::onClickClose( LLFloater* self ) void LLFloater::onClickCloseBtn(bool app_quitting) { // FIRE-24125: Add option to close all floaters of a group - if (mShiftPressed) + if (gKeyboard->currentMask(false) & MASK_SHIFT) { auto floaterlist = LLFloaterReg::getAllFloatersInGroup(this); for (auto floater : floaterlist) diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index ea8ca8ea95..169b1c00df 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -311,11 +311,6 @@ public: virtual BOOL handleScrollWheel(S32 x, S32 y, S32 mask); - // FIRE-24125: Add option to close all floaters of a group - virtual BOOL handleKeyHere(KEY key, MASK mask); - virtual BOOL handleKeyUpHere(KEY key, MASK mask); - // - virtual void draw(); virtual void drawShadow(LLPanel* panel); @@ -563,9 +558,6 @@ private: // MultiFloater without titlebar for hosted floater bool mHostedFloaterShowtitlebar; - - // FIRE-24125: Add option to close all floaters of a group - bool mShiftPressed; };