diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-05-08 21:41:11 +0300 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-05-08 21:41:11 +0300 |
commit | 93f0023efad59c6f86ee8003e3a22f1102ad28e8 (patch) | |
tree | ffb06811136a43a737aacfa844974e206f9f5537 /indra/llui/lltexteditor.cpp | |
parent | 922793e4898ec272576f32b79cc31b1c299e1e21 (diff) | |
parent | 34322f8f37380df868703051230f2a4109602b3f (diff) |
Merged in lindenlab/viewer-release
Diffstat (limited to 'indra/llui/lltexteditor.cpp')
-rw-r--r-- | indra/llui/lltexteditor.cpp | 22 |
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; } |