Skip to content
Snippets Groups Projects
Commit d9983255 authored by andreykproductengine's avatar andreykproductengine
Browse files

SL-10145 Right clicking on unselected link in editor near selected text shows wrong menu

parent d9fdb948
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment