From d4b7c6bfd503a1c7904ce658b4c1f120689e5fd9 Mon Sep 17 00:00:00 2001
From: Mnikolenko Productengine <mnikolenko@productengine.com>
Date: Tue, 24 Jan 2017 12:35:52 +0200
Subject: [PATCH] MAINT-7067 Issue with UI artifacts showing up in Abuse Report
 screenshots.

---
 indra/newview/app_settings/settings.xml | 11 +++++++++++
 indra/newview/llfloaterreporter.cpp     | 16 +++++++++++++---
 indra/newview/llfloaterreporter.h       |  2 ++
 3 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 1b09e446445..717deba8c7c 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -11812,6 +11812,17 @@
       <key>Value</key>
       <integer>75</integer>
     </map>
+    <key>AbuseReportScreenshotDelay</key>
+    <map>
+      <key>Comment</key>
+      <string>Time delay before taking screenshot to avoid UI artifacts.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>F32</string>
+      <key>Value</key>
+      <real>0.3</real>
+    </map>
     <key>SpeedTest</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp
index 275554540e5..515c2b0c4bd 100644
--- a/indra/newview/llfloaterreporter.cpp
+++ b/indra/newview/llfloaterreporter.cpp
@@ -35,6 +35,7 @@
 #include "llassetstorage.h"
 #include "llavatarnamecache.h"
 #include "llcachename.h"
+#include "llcallbacklist.h"
 #include "llcheckboxctrl.h"
 #include "llfontgl.h"
 #include "llimagebmp.h"
@@ -211,7 +212,7 @@ BOOL LLFloaterReporter::postBuild()
 	// grab the user's name
 	std::string reporter = LLSLURL("agent", gAgent.getID(), "inspect").getSLURLString();
 	getChild<LLUICtrl>("reporter_field")->setValue(reporter);
-	
+
 	center();
 
 	return TRUE;
@@ -837,8 +838,9 @@ void LLFloaterReporter::takeScreenshot(bool use_prev_screenshot)
 	}
 }
 
-void LLFloaterReporter::onOpen(const LLSD& key)
+void LLFloaterReporter::takeNewSnapshot()
 {
+	childSetEnabled("send_btn", true);
 	mImageRaw = new LLImageRaw;
 	const S32 IMAGE_WIDTH = 1024;
 	const S32 IMAGE_HEIGHT = 768;
@@ -867,10 +869,18 @@ void LLFloaterReporter::onOpen(const LLSD& key)
 			}
 		}
 	}
-
 	takeScreenshot();
 }
 
+
+void LLFloaterReporter::onOpen(const LLSD& key)
+{
+	childSetEnabled("send_btn", false);
+	//Time delay to avoid UI artifacts. MAINT-7067
+	doAfterInterval(boost::bind(&LLFloaterReporter::takeNewSnapshot,this), gSavedSettings.getF32("AbuseReportScreenshotDelay"));
+
+}
+
 void LLFloaterReporter::onLoadScreenshotDialog(const LLSD& notification, const LLSD& response)
 {
 	S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
diff --git a/indra/newview/llfloaterreporter.h b/indra/newview/llfloaterreporter.h
index e5232268c09..decc01be984 100644
--- a/indra/newview/llfloaterreporter.h
+++ b/indra/newview/llfloaterreporter.h
@@ -107,6 +107,8 @@ class LLFloaterReporter
 
 	void onLoadScreenshotDialog(const LLSD& notification, const LLSD& response);
 
+	void takeNewSnapshot();
+
 private:
 	static void show(const LLUUID& object_id, const std::string& avatar_name = LLStringUtil::null, const LLUUID& experience_id = LLUUID::null);
 
-- 
GitLab