summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llappviewer.cpp65
-rw-r--r--indra/newview/llappviewerwin32.cpp16
-rw-r--r--indra/newview/llvelopack.cpp163
-rw-r--r--indra/newview/llvoicewebrtc.cpp20
-rw-r--r--indra/newview/skins/default/xui/en/floater_performance.xml8
-rw-r--r--indra/newview/skins/default/xui/en/floater_toybox.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml20
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_sound.xml26
-rw-r--r--indra/newview/skins/default/xui/en/widgets/toolbar.xml2
9 files changed, 210 insertions, 112 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 412f010ae2..c74c0db08c 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -4626,13 +4626,66 @@ void LLAppViewer::purgeCefStaleCaches()
LL_PROFILE_ZONE_SCOPED;
// TODO: we really shouldn't use a hard coded name for the cache folder here...
const std::string browser_parent_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "cef_cache");
- if (LLFile::isdir(browser_parent_cache))
+ if (!LLFile::isdir(browser_parent_cache))
{
- // This is a sledgehammer approach - nukes the cef_cache dir entirely
- // which is then recreated the first time a CEF instance creates an
- // individual cache folder. If we ever decide to retain some folders
- // e.g. Search UI cache - then we will need a more granular approach.
- gDirUtilp->deleteDirAndContents(browser_parent_cache);
+ return;
+ }
+ // We are using a fixed name to not leave stale folders
+ // around in case something goes wrong on startup.
+ const std::string holder_cache_name = browser_parent_cache + "_rename";
+
+ // Try to rename the entire directory first
+ if (LLFile::rename(browser_parent_cache, holder_cache_name) == 0)
+ {
+ LL_DEBUGS("AppInit") << "Successfully renamed CEF cache folder for deletion" << LL_ENDL;
+ }
+ else
+ {
+ // Rename failed (likely another instance has files open in the cache)
+ // Create holder folder and move individual subfolders instead
+ LL_DEBUGS("AppInit") << "Could not rename CEF cache folder (may be in use), moving individual folders" << LL_ENDL;
+
+ if (!LLFile::isdir(holder_cache_name) && LLFile::mkdir(holder_cache_name) != 0)
+ {
+ LL_WARNS() << "Failed to create holder folder: " << holder_cache_name << LL_ENDL;
+ // Attept normal cleanup
+ gDirUtilp->deleteDirAndContents(browser_parent_cache);
+ return;
+ }
+
+ // Iterate through subdirectories in the cache folder
+ LLDirIterator dir_iter(browser_parent_cache, "*");
+ std::string subfolder_name;
+ while (dir_iter.next(subfolder_name))
+ {
+ if (subfolder_name == "." || subfolder_name == "..")
+ {
+ continue;
+ }
+
+ std::string source_path = browser_parent_cache + gDirUtilp->getDirDelimiter() + subfolder_name;
+ std::string dest_path = holder_cache_name + gDirUtilp->getDirDelimiter() + subfolder_name;
+
+ // If folder is in use, move will fail, don't delete it.
+ LLFile::rename(source_path, dest_path);
+ }
+ }
+
+ // Post deletion task to the General work queue to avoid blocking the main thread
+ if (auto queue = LL::WorkQueue::getInstance("General"))
+ {
+ // Alternatively throw it at LLPurgeDiskCacheThread to clean
+ // it during periodic purges.
+ queue->post([holder_cache_name]()
+ {
+ LL_PROFILE_ZONE_NAMED("cef_cache_cleanup");
+ gDirUtilp->deleteDirAndContents(holder_cache_name);
+ });
+ }
+ else
+ {
+ LL_WARNS() << "Failed to get General work queue, deleting CEF cache synchronously" << LL_ENDL;
+ gDirUtilp->deleteDirAndContents(holder_cache_name);
}
}
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index 3ebd8c7019..e5fc256981 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -455,22 +455,8 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
// commands and exit the process before we do anything else.
if (!velopack_initialize())
{
+ // Obsolete? Always return true
// Velopack handled the invocation (install/uninstall hook)
-
- // Drop install related settings
- gDirUtilp->initAppDirs("SecondLife");
-
- std::string user_settings_path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings.xml");
- LLControlGroup settings("global");
- if (settings.loadFromFile(user_settings_path))
- {
- // If user reinstalls or updates, we want to recheck for nsis leftovers.
- if (settings.controlExists("PreviousInstallChecked"))
- {
- settings.setBOOL("PreviousInstallChecked", false);
- }
- settings.saveToFile(user_settings_path, true);
- }
return 0;
}
#endif
diff --git a/indra/newview/llvelopack.cpp b/indra/newview/llvelopack.cpp
index 7a013dafb5..6a667925b3 100644
--- a/indra/newview/llvelopack.cpp
+++ b/indra/newview/llvelopack.cpp
@@ -500,6 +500,73 @@ static bool paths_are_equal(const std::wstring& path1, const std::wstring& path2
}
}
+static void update_taskbar_shortcut(const std::string& nsis_folder_path, const std::wstring& appdata_path, const std::wstring& app_name, const std::wstring& link_name)
+{
+ std::wstring taskbar_path = appdata_path;
+ taskbar_path += L"\\Microsoft\\Internet Explorer\\Quick Launch\\User Pinned\\TaskBar\\";
+ taskbar_path += link_name;
+
+ if (!PathFileExistsW(taskbar_path.c_str()))
+ {
+ // User didn't create one
+ return;
+ }
+
+ // Verify we are removing or updating the right thing.
+ // It is not warranteed that the shortcut points to NSIS.
+ std::wstring target_path;
+ if (get_shortcut_target(taskbar_path, target_path))
+ {
+ // Strip the filename part to get just the folder path
+ std::filesystem::path trim_path(target_path);
+ if (trim_path.has_filename())
+ {
+ target_path = trim_path.parent_path().wstring();
+ }
+ std::wstring nsis_path_w = ll_convert<std::wstring>(nsis_folder_path);
+ if (!paths_are_equal(nsis_path_w, target_path))
+ {
+ // Shortcut points to something else, don't mess with it
+ LL_INFOS("Velopack") << "Found a matching shortcut, but it points to a different channel. Expected: "
+ << ll_convert_wide_to_string(nsis_path_w)
+ << ", actual: " << ll_convert_wide_to_string(target_path)
+ << LL_ENDL;
+ return;
+ }
+ }
+
+ // First try to overwrite shortcut
+ std::wstring current_exe = ll_convert<std::wstring>(gDirUtilp->getExecutablePathAndName());
+ HRESULT hr = create_shortcut(taskbar_path, current_exe, L"", app_name, current_exe);
+ if (SUCCEEDED(hr))
+ {
+ LL_INFOS("Velopack") << "Successfully updated taskbar shortcut to point to current exe" << LL_ENDL;
+ return;
+ }
+
+ // Try deleting and if possible, recreating separately. We should not leave hanging shortcuts behind.
+ if (!DeleteFileW(taskbar_path.c_str()))
+ {
+ DWORD error = GetLastError();
+ if (error != ERROR_FILE_NOT_FOUND)
+ {
+ LL_WARNS("Velopack") << "Failed to delete NSIS taskbar shortcut: "
+ << ll_convert_wide_to_string(taskbar_path)
+ << " (error: " << error << ")" << LL_ENDL;
+ }
+ }
+ else
+ {
+ // Deleted user created link, recreate it with new target if possible.
+ LL_INFOS("Velopack") << "Updating taskbar shortcut to point to current exe" << LL_ENDL;
+ HRESULT hr = create_shortcut(taskbar_path, current_exe, L"", app_name, current_exe);
+ if (FAILED(hr))
+ {
+ LL_WARNS("Velopack") << "Failed to re-create taskbar shortcut, error: " << std::hex << hr << ", NSIS shortcut was removed" << LL_ENDL;
+ }
+ }
+}
+
void clear_nsis_links(const std::string& nsis_folder_path)
{
wchar_t path[MAX_PATH];
@@ -544,68 +611,17 @@ void clear_nsis_links(const std::string& nsis_folder_path)
}
}
- // 3. Taskbar link, which is user-specific and located at:
- // %AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Second Life.lnk
- // Note that it can be a link to velopack already, but since
- // we aren't removing, but recreating, it shouldn't be an issue.
+ // 3. Taskbar links, which are user-specific and located at:
+ // %AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\
+ // Note that it can be a link to velopack already or to a different NSIS viewer.
+ // Name might also be different based on method of creation.
if (SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_APPDATA, NULL, 0, path)))
{
- std::wstring taskbar_path = path;
- // Hardcoded, because this name is the default window name and isn't going to change in NSIS
- taskbar_path += L"\\Microsoft\\Internet Explorer\\Quick Launch\\User Pinned\\TaskBar\\Second Life.lnk";
-
- if (PathFileExistsW(taskbar_path.c_str()))
- {
- // First try to overwrite shortcut
- std::wstring current_exe = ll_convert<std::wstring>(gDirUtilp->getExecutablePathAndName());
-
- HRESULT hr = create_shortcut(taskbar_path, current_exe, L"", app_name, current_exe);
- if (FAILED(hr))
- {
- LL_WARNS("Velopack") << "Failed to update taskbar shortcut, error " << std::hex << hr << LL_ENDL;
- // Try deleting and if possible recreating separately. We should not leave hanging shortcuts behind.
- // It is not warranted that the shortcut points to NSIS, so check the destination first.
- std::wstring target_path;
- if (get_shortcut_target(taskbar_path, target_path))
- {
- // Strip the filename part to get just the folder path
- std::filesystem::path trim_path(target_path);
- if (trim_path.has_filename())
- {
- target_path = trim_path.parent_path().wstring();
- }
- std::wstring nsis_path_w = ll_convert<std::wstring>(nsis_folder_path);
- if (paths_are_equal(nsis_path_w, target_path))
- {
- if (!DeleteFileW(taskbar_path.c_str()))
- {
- DWORD error = GetLastError();
- if (error != ERROR_FILE_NOT_FOUND)
- {
- LL_WARNS("Velopack") << "Failed to delete NSIS taskbar shortcut: "
- << ll_convert_wide_to_string(taskbar_path)
- << " (error: " << error << ")" << LL_ENDL;
- }
- }
- else
- {
- // Deleted user created link, recreate it with new target if possible.
- LL_INFOS("Velopack") << "Updating taskbar shortcut to point to current exe" << LL_ENDL;
- HRESULT hr = create_shortcut(taskbar_path, current_exe, L"", app_name, current_exe);
- if (FAILED(hr))
- {
- LL_WARNS("Velopack") << "Failed to re-create taskbar shortcut, error: " << std::hex << hr << ", NSIS shortcut was removed" << LL_ENDL;
- }
- }
- }
- }
- }
- else
- {
- LL_INFOS("Velopack") << "Successfully updated taskbar shortcut to point to current exe" << LL_ENDL;
- }
- }
- // else user didn't create a taskbar shortcut.
+ update_taskbar_shortcut(nsis_folder_path, path, app_name, L"Second Life.lnk"); // Window class name
+ update_taskbar_shortcut(nsis_folder_path, path, app_name, L"Second Life(1).lnk"); // Just in case user somehow did it twice and removed first
+ update_taskbar_shortcut(nsis_folder_path, path, app_name, L"SecondLifeViewer.lnk"); // Executable name
+ update_taskbar_shortcut(nsis_folder_path, path, app_name, L"secondlife-bin.lnk"); // Debug builds
+ update_taskbar_shortcut(nsis_folder_path, path, app_name, app_name + L".lnk"); // Default name
}
}
@@ -817,6 +833,33 @@ static void on_first_run(void* p_user_data, const char* app_version)
MultiByteToWideChar(CP_UTF8, 0, app_version, -1, &version[0], len);
register_uninstall_info(install_dir, app_name, version);
+
+ // Drop install related settings
+ // Unfortunately gDirUtilp is not initialized yet and it's shouldn't
+ // be possible to change location of the settings. For now it's simpler
+ // to hardcode the location.
+ std::optional<std::string> app_data = LLStringUtil::getoptenv("APPDATA");
+ if (app_data)
+ {
+ // Strip trailing delimiter if present
+ std::string app_data_path = *app_data;
+ if (!app_data_path.empty() && (app_data_path.back() == '\\' || app_data_path.back() == '/'))
+ {
+ app_data_path.pop_back();
+ }
+
+ std::string user_settings_path = app_data_path + "\\SecondLife\\user_settings\\settings.xml";
+ LLControlGroup settings("global");
+ if (settings.loadFromFile(user_settings_path))
+ {
+ // If user reinstalls or updates, we want to recheck for nsis leftovers.
+ if (settings.controlExists("PreviousInstallChecked"))
+ {
+ settings.setBOOL("PreviousInstallChecked", false);
+ }
+ settings.saveToFile(user_settings_path, true);
+ }
+ }
}
static void on_after_install(void* user_data, const char* app_version)
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index 7caac0a267..c6967a8743 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -3100,6 +3100,13 @@ void LLVoiceWebRTCConnection::OnDataReceivedImpl(const std::string &data, bool b
LL_WARNS("Voice") << "Expected object from data channel:" << data << LL_ENDL;
return;
}
+
+ bool is_primary_region = mPrimary;
+ if (!mPrimary && isSpatial() && gAgent.getRegion())
+ {
+ is_primary_region = (mRegionID == gAgent.getRegion()->getRegionID());
+ LL_WARNS() << "mPrimary is false, expected: " << is_primary_region << " connection state: " << getVoiceConnectionState() << LL_ENDL;
+ }
boost::json::object voice_data = voice_data_parsed.as_object();
boost::json::object mute;
boost::json::object user_gain;
@@ -3189,7 +3196,7 @@ void LLVoiceWebRTCConnection::OnDataReceivedImpl(const std::string &data, bool b
if (isSpatial())
{
// ignore muted flags from non-primary server
- if (mPrimary || primary)
+ if (is_primary_region || primary)
{
participant->mIsModeratorMuted = is_moderator_muted;
if (gAgentID == agent_id)
@@ -3207,11 +3214,15 @@ void LLVoiceWebRTCConnection::OnDataReceivedImpl(const std::string &data, bool b
}
else
{
- if (isSpatial() && (mPrimary || primary))
+ if (isSpatial() && (is_primary_region || primary))
{
// mute info message can be received before join message, so try to mute again later
if (participant_obj.contains("m") && participant_obj["m"].is_bool())
{
+ LL_WARNS() << "Mute info msg received: " << participant_obj["m"].as_bool()
+ << " but participant " << agent_id
+ << " was not found in channel " << mChannelID << LL_ENDL;
+
bool is_moderator_muted = participant_obj["m"].as_bool();
std::string channel_id = mChannelID;
F32 delay { 1.5f };
@@ -3223,11 +3234,16 @@ void LLVoiceWebRTCConnection::OnDataReceivedImpl(const std::string &data, bool b
if (participant)
{
participant->mIsModeratorMuted = is_moderator_muted;
+ LL_WARNS() << "Participant " << agent_id << " is found after delay, is_muted: " << is_moderator_muted << LL_ENDL;
if (gAgentID == agent_id)
{
LLNearbyVoiceModeration::getInstance()->setMutedInfo(channel_id, is_moderator_muted);
}
}
+ else
+ {
+ LL_WARNS() << "Participant " << agent_id << " is still not found in channel " << channel_id << LL_ENDL;
+ }
}, delay);
}
}
diff --git a/indra/newview/skins/default/xui/en/floater_performance.xml b/indra/newview/skins/default/xui/en/floater_performance.xml
index dac8a71b2d..5fb9eeb2de 100644
--- a/indra/newview/skins/default/xui/en/floater_performance.xml
+++ b/indra/newview/skins/default/xui/en/floater_performance.xml
@@ -65,10 +65,10 @@
text_color="White"
height="20"
layout="topleft"
- left="395"
+ left="392"
top="7"
name="fps_desc1_lbl"
- width="150">
+ width="153">
Allow 5-10 seconds for
</text>
<text
@@ -78,7 +78,7 @@
layout="topleft"
top_pad="-3"
name="fps_desc2_lbl"
- width="150">
+ width="153">
changes to take full effect.
</text>
</panel>
@@ -265,7 +265,7 @@
left="10"
name="complexity_info"
top_pad="0"
- width="455">
+ width="490">
Reduce the complexity of your avatar if you aren't satisfied with current FPS.
</text>
<icon
diff --git a/indra/newview/skins/default/xui/en/floater_toybox.xml b/indra/newview/skins/default/xui/en/floater_toybox.xml
index 7fe9830d23..64c97b1a11 100644
--- a/indra/newview/skins/default/xui/en/floater_toybox.xml
+++ b/indra/newview/skins/default/xui/en/floater_toybox.xml
@@ -49,7 +49,7 @@
button_display_mode="icons_with_text"
follows="all"
left="20"
- button_icon_and_text.button_width.max="140"
+ button_icon_and_text.button_width.max="145"
button_icon_and_text.button_width.min="70"
name="toybox_toolbar"
pad_left="5"
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
index 8f13720f3e..9d55db27b8 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
@@ -114,7 +114,7 @@
follows="left|top"
height="12"
layout="topleft"
- left_delta="360"
+ left_delta="363"
name="BetterText"
top_delta="0"
width="100">
@@ -217,14 +217,14 @@
max_val="512"
name="DrawDistance"
top_delta="34"
- width="427" />
+ width="428" />
<text
type="string"
length="1"
follows="left|top"
height="12"
layout="topleft"
- left_delta="427"
+ left_delta="425"
name="DrawDistanceMeterText2"
top_delta="0"
width="128">
@@ -286,7 +286,7 @@
initial_value="101"
increment="1"
label="Avatar maximum complexity:"
- label_width="165"
+ label_width="187"
layout="topleft"
left="30"
min_val="1"
@@ -294,7 +294,7 @@
name="IndirectMaxComplexity"
show_text="false"
top_delta="28"
- width="300">
+ width="394">
<slider.commit_callback
function="Pref.UpdateIndirectMaxComplexity"
parameter="IndirectMaxComlexityText" />
@@ -306,7 +306,7 @@
height="16"
layout="topleft"
top_delta="0"
- left_delta="304"
+ left_delta="398"
text_readonly_color="LabelDisabledColor"
name="IndirectMaxComplexityText"
width="65">
@@ -329,7 +329,7 @@
label_width="240"
left="30"
top_delta="20"
- width="393">
+ width="394">
<slider.commit_callback
function="Pref.UpdateIndirectMaxNonImpostors"
parameter="IndirectNonImpostorsText" />
@@ -341,7 +341,7 @@
height="16"
layout="topleft"
top_delta="0"
- left_delta="397"
+ left_delta="398"
text_readonly_color="LabelDisabledColor"
name="IndirectMaxNonImpostorsText"
width="65">
@@ -369,7 +369,7 @@
increment="0.1"
initial_value="160"
label="Brightness (exposure)"
- label_width="145"
+ label_width="187"
layout="topleft"
left="30"
min_val="0.5"
@@ -377,7 +377,7 @@
name="RenderExposure"
show_text="true"
top_pad="14"
- width="260">
+ width="424">
</slider>
<!-- End of Basic Settings block -->
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml
index af3b2d6cb5..36c3b2dedd 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml
@@ -319,7 +319,7 @@
top_delta="25"
name="Listen media from"
height="15"
- width="175"
+ width="180"
halign="right">
Hear media and sounds from
</text>
@@ -346,7 +346,7 @@
layout="topleft"
height="15"
left="23"
- width="175"
+ width="180"
name="media_autoplay_label"
halign="right">
Auto-play media
@@ -357,7 +357,7 @@
follows="left|top"
layout="topleft"
height="23"
- left_delta="180"
+ left_delta="185"
top_delta="-4"
name="media_auto_play_combo"
width="130">
@@ -379,7 +379,7 @@
layout="topleft"
height="15"
left="23"
- width="175"
+ width="180"
name="media_firstinteract_label"
halign="right">
Media first-interact
@@ -390,7 +390,7 @@
follows="left|top"
layout="topleft"
height="23"
- left_delta="180"
+ left_delta="185"
top_delta="-4"
width="130"
name="media_first_interact_combo"
@@ -458,7 +458,7 @@
layout="topleft"
follows="left"
height="15"
- width="175"
+ width="180"
name="noise_suppression_label"
left="23"
top_delta="22"
@@ -470,7 +470,7 @@
enabled_control="EnableVoiceChat"
follows="left|top"
layout="topleft"
- left_delta="180"
+ left_delta="185"
top_delta="-6"
width="130"
height="23"
@@ -504,7 +504,7 @@
left="23"
top_delta="30"
name="Listen from"
- width="175"
+ width="180"
height="15"
halign="right">
Hear voice from
@@ -514,7 +514,7 @@
control_name="VoiceEarLocation"
follows="left|top"
layout="topleft"
- left_delta="180"
+ left_delta="185"
top_delta="-6"
width="130"
height="23"
@@ -546,7 +546,7 @@
tool_tip="Check to enable voice echo cancellation"
label="Echo Cancellation"
layout="topleft"
- left="260"
+ left="270"
name="enable_echo_cancellation"
top_pad="-15"
width="200"/>
@@ -559,7 +559,7 @@
layout="topleft"
left="20"
name="push_to_talk_toggle_check"
- width="237"
+ width="245"
tool_tip="When in toggle mode, press and release the trigger key ONCE to switch your microphone on or off. When not in toggle mode, the microphone broadcasts your voice only while the trigger is being held down."
top_pad="5"/>
<check_box
@@ -570,7 +570,7 @@
label="Automatic Gain Control"
layout="topleft"
name="voice_automatic_gain_control"
- left="260"
+ left="270"
top_pad="-15"
width="200"/>
<check_box
@@ -592,7 +592,7 @@
label="Show voice dot above avatars"
layout="topleft"
name="voice_dot_visualizer"
- left="260"
+ left="270"
top_pad="-15"
width="200"/>
<button
diff --git a/indra/newview/skins/default/xui/en/widgets/toolbar.xml b/indra/newview/skins/default/xui/en/widgets/toolbar.xml
index 33b431c6e5..95b2a3866d 100644
--- a/indra/newview/skins/default/xui/en/widgets/toolbar.xml
+++ b/indra/newview/skins/default/xui/en/widgets/toolbar.xml
@@ -21,7 +21,7 @@
image_disabled_selected="PushButton_Selected_Disabled"
image_disabled="PushButton_Disabled"
button_width.min="70"
- button_width.max="140"
+ button_width.max="145"
desired_height="24"
pad_left="10"
pad_right="10"