From d76e8dd61120fd82dbfbed786d803d16af7d6d4d Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 3 Oct 2024 23:08:52 +0300 Subject: viewer-private#300 Fix inconsistency with multiple textures --- indra/newview/lltexturectrl.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 35057a910a..f125d81430 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -1029,8 +1029,11 @@ void LLFloaterTexturePicker::onBtnCancel(void* userdata) void LLFloaterTexturePicker::onBtnSelect(void* userdata) { LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - if (self->mOnFloaterCommitCallback) + if (self->mViewModel->isDirty() && self->mOnFloaterCommitCallback) { + // If nothing changed, don't commit. + // ex: can overwrite multiple original textures with a single one. + // or resubmit something thus overriding some other source of change self->commitCallback(LLTextureCtrl::TEXTURE_SELECT); } self->closeFloater(); @@ -1067,8 +1070,18 @@ void LLFloaterTexturePicker::onSelectionChange(const std::dequeisDirty(); setImageIDFromItem(itemp, false); - mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? + if (user_action) + { + mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? + setTentative( false ); + } + else if (!was_dirty) + { + // setImageIDFromItem could have dropped the flag + mViewModel->resetDirty(); + } if(!mPreviewSettingChanged) { -- cgit v1.2.3