summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorKitty Barnett <develop@catznip.com>2022-10-23 17:47:51 +0200
committerKitty Barnett <develop@catznip.com>2022-10-23 16:29:12 +0200
commit58cdcd5dd23778c6fad9fa0da31b670ceff8eeeb (patch)
tree006bac63739acc32b6d11b61c30931fe3796632d /indra/llui
parent8d08f417dc1f5b2681774f000951993e0f0cf79f (diff)
Handle return and escape in the mini emoji helper
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llemojihelper.cpp5
-rw-r--r--indra/llui/llemojihelper.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/indra/llui/llemojihelper.cpp b/indra/llui/llemojihelper.cpp
index d4c31ee986..54c801ab7b 100644
--- a/indra/llui/llemojihelper.cpp
+++ b/indra/llui/llemojihelper.cpp
@@ -98,6 +98,11 @@ void LLEmojiHelper::showHelper(LLUICtrl* hostctrl_p, S32 local_x, S32 local_y, c
void LLEmojiHelper::hideHelper(const LLUICtrl* ctrl_p)
{
+ if (ctrl_p && !isActive(ctrl_p))
+ {
+ return;
+ }
+
setHostCtrl(nullptr);
}
diff --git a/indra/llui/llemojihelper.h b/indra/llui/llemojihelper.h
index 7ed042fc5f..63f5c640c9 100644
--- a/indra/llui/llemojihelper.h
+++ b/indra/llui/llemojihelper.h
@@ -45,7 +45,7 @@ public:
bool isActive(const LLUICtrl* ctrl_p) const;
static bool isCursorInEmojiCode(const LLWString& wtext, S32 cursor_pos, S32* short_code_pos_p = nullptr);
void showHelper(LLUICtrl* hostctrl_p, S32 local_x, S32 local_y, const std::string& short_code, std::function<void(LLWString)> commit_cb);
- void hideHelper(const LLUICtrl* ctrl_p);
+ void hideHelper(const LLUICtrl* ctrl_p = nullptr);
// Eventing
bool handleKey(const LLUICtrl* ctrl_p, KEY key, MASK mask);