summaryrefslogtreecommitdiff
path: root/indra/llui/lltexteditor.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2019-04-26 11:17:53 -0400
committerNat Goodspeed <nat@lindenlab.com>2019-04-26 11:17:53 -0400
commit0d596aa4de2f583862274350ce6287c0ed8c2bec (patch)
tree90a6ca5b29d5c99b585233d059e16dccc23a2e19 /indra/llui/lltexteditor.cpp
parent70aa89f708254c47766f4629e9131ea492829129 (diff)
parent85b431d5137886927efef35ca558bc8a998a5212 (diff)
Automated merge with file:///Users/nat/linden/viewer-gridselect
Diffstat (limited to 'indra/llui/lltexteditor.cpp')
-rw-r--r--indra/llui/lltexteditor.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 134b76c720..137167db2a 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -732,14 +732,30 @@ BOOL LLTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
setFocus(TRUE);
}
+
+ bool show_menu = false;
+
// Prefer editor menu if it has selection. See EXT-6806.
- if (hasSelection() || !LLTextBase::handleRightMouseDown(x, y, mask))
+ if (hasSelection())
{
- if(getShowContextMenu())
+ S32 click_pos = getDocIndexFromLocalCoord(x, y, FALSE);
+ if (click_pos > mSelectionStart && click_pos < mSelectionEnd)
{
- showContextMenu(x, y);
+ show_menu = true;
}
}
+
+ // Let segments handle the click, if nothing does, show editor menu
+ if (!show_menu && !LLTextBase::handleRightMouseDown(x, y, mask))
+ {
+ show_menu = true;
+ }
+
+ if (show_menu && getShowContextMenu())
+ {
+ showContextMenu(x, y);
+ }
+
return TRUE;
}