From 7fc1d9a1aec58acfc4359ffa45c8b1ce342fb2d8 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 9 Apr 2026 00:08:07 +0300 Subject: #5607 workaround fix for the web content being black after resizing --- indra/llplugin/llpluginclassmedia.cpp | 12 ++++++++++++ indra/llplugin/llpluginclassmedia.h | 2 ++ 2 files changed, 14 insertions(+) (limited to 'indra/llplugin') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 77a4b08af5..a1e1f75367 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -1641,3 +1641,15 @@ void LLPluginClassMedia::initializeUrlHistory(const LLSD& url_history) LL_DEBUGS("Plugin") << "Sending history" << LL_ENDL; } + +void LLPluginClassMedia::forceRenderRefresh() +{ + // Force layout recalculation by briefly hiding/showing the web content + // Used to clear black screen issues after resize, see #5607 + const std::string refresh_script = + "document.documentElement.style.visibility='hidden';" + "document.documentElement.offsetHeight;" + "document.documentElement.style.visibility='';"; + + executeJavaScript(refresh_script); +} diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 71522bcd7d..40f6295e55 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -350,6 +350,8 @@ public: std::shared_ptr getSharedPtr() { return std::dynamic_pointer_cast(shared_from_this()); } // due to enable_shared_from_this + void forceRenderRefresh(); + protected: LLPluginClassMediaOwner *mOwner; -- cgit v1.3