Merge "Fix the cursor position when retrieving the selected text." into devel/master