From d82d94f41cab2f347ac2b9ff7b9153603c81d39a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 14 Sep 2022 20:52:04 +0300 Subject: SL-18153 Fix invisible blocking popup Don't add popup to the list twice --- indra/llui/llmodaldialog.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp index 5cfa8ea973..50fc6913a9 100644 --- a/indra/llui/llmodaldialog.cpp +++ b/indra/llui/llmodaldialog.cpp @@ -100,7 +100,10 @@ void LLModalDialog::onOpen(const LLSD& key) if (!sModalStack.empty()) { LLModalDialog* front = sModalStack.front(); - front->setVisible(FALSE); + if (front != this) + { + front->setVisible(FALSE); + } } // This is a modal dialog. It sucks up all mouse and keyboard operations. @@ -108,7 +111,12 @@ void LLModalDialog::onOpen(const LLSD& key) LLUI::getInstance()->addPopup(this); setFocus(TRUE); - sModalStack.push_front( this ); + std::list::iterator iter = std::find(sModalStack.begin(), sModalStack.end(), this); + if (iter == sModalStack.end()) + { + sModalStack.push_front(this); + } + // else act like it is a 'bring to front' } } -- cgit v1.2.3 From 3248eb87dc80d7c215c24107f5968eda00ad4a9f Mon Sep 17 00:00:00 2001 From: Callum Linden Date: Wed, 14 Sep 2022 14:52:31 -0700 Subject: SL-18151 [SEC] MOAP can force multiple floaters open on users screen: The Viewer part of the fix for this JIRA - pulls in the updated Dullahan that exposes the user_gesture/is_redirect flags and uses them to determine what type of 'nav_type' is exchanged with viewer/plugin --- autobuild.xml | 14 +++++++------- indra/media_plugins/cef/media_plugin_cef.cpp | 17 ++++++++++++----- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index f53b3c66c6..5a5ffa2898 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -482,9 +482,9 @@ archive hash - 012aaadd1c40d430866bebda2e60bfae + 439d92ec73f0500ba1671faad2bd8090 url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/100136/882323/dullahan-1.12.3.202205202122_91.1.21_g9dd45fe_chromium-91.0.4472.114-darwin64-572002.tar.bz2 + https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/104637/916643/dullahan-1.12.4.202209142017_91.1.21_g9dd45fe_chromium-91.0.4472.114-darwin64-575005.tar.bz2 name darwin64 @@ -494,9 +494,9 @@ archive hash - ff1c56b7a28c689442f6439421bb32f5 + 2a7c01da15de77bc1fd1863327174d5e url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/100149/882391/dullahan-1.12.3.202205202205_91.1.21_g9dd45fe_chromium-91.0.4472.114-windows-572002.tar.bz2 + https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/104638/916654/dullahan-1.12.4.202209142021_91.1.21_g9dd45fe_chromium-91.0.4472.114-windows-575005.tar.bz2 name windows @@ -506,16 +506,16 @@ archive hash - bbfe23d7f211865b81b291884949a887 + d06bee9b2517fbb09ba1a65e6d675361 url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/100148/882385/dullahan-1.12.3.202205202202_91.1.21_g9dd45fe_chromium-91.0.4472.114-windows64-572002.tar.bz2 + https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/104639/916659/dullahan-1.12.4.202209142021_91.1.21_g9dd45fe_chromium-91.0.4472.114-windows64-575005.tar.bz2 name windows64 version - 1.12.3.202205202205_91.1.21_g9dd45fe_chromium-91.0.4472.114 + 1.12.4.202209142021_91.1.21_g9dd45fe_chromium-91.0.4472.114 expat diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 042abcf80e..43d3a32e64 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -56,7 +56,7 @@ private: bool init(); void onPageChangedCallback(const unsigned char* pixels, int x, int y, const int width, const int height); - void onCustomSchemeURLCallback(std::string url); + void onCustomSchemeURLCallback(std::string url, bool user_gesture, bool is_redirect); void onConsoleMessageCallback(std::string message, std::string source, int line); void onStatusMessageCallback(std::string value); void onTitleChangeCallback(std::string title); @@ -300,11 +300,18 @@ void MediaPluginCEF::onOpenPopupCallback(std::string url, std::string target) //////////////////////////////////////////////////////////////////////////////// // -void MediaPluginCEF::onCustomSchemeURLCallback(std::string url) +void MediaPluginCEF::onCustomSchemeURLCallback(std::string url, bool user_gesture, bool is_redirect) { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_nofollow"); - message.setValue("uri", url); - message.setValue("nav_type", "clicked"); // TODO: differentiate between click and navigate to + message.setValue("uri", url); + + // indicate if this interaction was from a user click (okay on a SLAPP) or + // via a navigation (e.g. a data URL - see SL-18151) (not okay on a SLAPP) + const std::string nav_type = user_gesture ? "clicked" : "navigated"; + + message.setValue("nav_type", nav_type); + message.setValueBoolean("is_redirect", is_redirect); + sendMessage(message); } @@ -593,7 +600,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { // event callbacks from Dullahan mCEFLib->setOnPageChangedCallback(std::bind(&MediaPluginCEF::onPageChangedCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5)); - mCEFLib->setOnCustomSchemeURLCallback(std::bind(&MediaPluginCEF::onCustomSchemeURLCallback, this, std::placeholders::_1)); + mCEFLib->setOnCustomSchemeURLCallback(std::bind(&MediaPluginCEF::onCustomSchemeURLCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); mCEFLib->setOnConsoleMessageCallback(std::bind(&MediaPluginCEF::onConsoleMessageCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); mCEFLib->setOnStatusMessageCallback(std::bind(&MediaPluginCEF::onStatusMessageCallback, this, std::placeholders::_1)); mCEFLib->setOnTitleChangeCallback(std::bind(&MediaPluginCEF::onTitleChangeCallback, this, std::placeholders::_1)); -- cgit v1.2.3 From dd5aa8f6f4224ecec8bc3b2bc5e9018cc7ff83da Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 15 Sep 2022 01:56:47 +0300 Subject: SL-18153 Fixed bring to front multiple dialog handling --- indra/llui/llmodaldialog.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp index 50fc6913a9..3e5978eb59 100644 --- a/indra/llui/llmodaldialog.cpp +++ b/indra/llui/llmodaldialog.cpp @@ -112,11 +112,13 @@ void LLModalDialog::onOpen(const LLSD& key) setFocus(TRUE); std::list::iterator iter = std::find(sModalStack.begin(), sModalStack.end(), this); - if (iter == sModalStack.end()) + if (iter != sModalStack.end()) { - sModalStack.push_front(this); + // if already present, we want to move it to front. + sModalStack.erase(iter); } - // else act like it is a 'bring to front' + + sModalStack.push_front(this); } } -- cgit v1.2.3