summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2023-11-30 14:09:50 +0100
committerGuru <alexandrgproductengine@lindenlab.com>2023-11-30 15:57:35 +0100
commit54db4206e9302e7510bc4f103ff59714c1be942d (patch)
tree06ac328d75e14aa8bcaf847a6b24066d9e278d1d /indra
parent2fad5a770b3583e576992d075c24bc0e25443053 (diff)
SL-19801 Inserting emoji characters from system emoji picker does not work on macOS
Diffstat (limited to 'indra')
-rw-r--r--indra/llwindow/llopenglview-objc.mm13
1 files changed, 13 insertions, 0 deletions
diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm
index 7936245744..5527094021 100644
--- a/indra/llwindow/llopenglview-objc.mm
+++ b/indra/llwindow/llopenglview-objc.mm
@@ -718,6 +718,19 @@ attributedStringInfo getSegments(NSAttributedString *str)
- (void)insertText:(id)aString replacementRange:(NSRange)replacementRange
{
+ // SL-19801 Special workaround for system emoji picker
+ if ([aString length] == 2)
+ {
+ uint32_t b0 = [aString characterAtIndex:0];
+ uint32_t b1 = [aString characterAtIndex:1];
+ if (((b0 & 0xF000) == 0xD000) && ((b1 & 0xF000) == 0xD000))
+ {
+ uint32_t b = 0x10000 | ((b0 & 0x3F) << 10) | (b1 & 0x3FF);
+ callUnicodeCallback(b, 0);
+ return;
+ }
+ }
+
if (!mHasMarkedText)
{
for (NSInteger i = 0; i < [aString length]; i++)