secondlife / viewer

🖥️ Second Life's official client
GNU Lesser General Public License v2.1
209 stars 53 forks source link

Keypresses to text input fields are duplicated #2870

Open maestrolinden opened 1 day ago

maestrolinden commented 1 day ago

Environment

Second Life Test 7.1.12.11370694217 (64bit) Release Notes

You are at 36.7, 134.1, 21.3 in Tustin located at simhost-0d8e20bef03d618f9.agni SLURL: http://maps.secondlife.com/secondlife/Tustin/37/134/21 (global coordinates 244773.0, 328326.0, 21.3) Second Life RC LeTigre 2024-09-13.10853867644 Release Notes

CPU: Apple M1 Pro (2400 MHz) Memory: 16384 MB OS Version: macOS 14.7.0 Darwin 23.6.0 Darwin Kernel Version 23.6.0: Wed Jul 31 20:49:39 PDT 2024; root:xnu-10063.141.1.700.5~1/RELEASE_ARM64_T6000 x86_64 Graphics Card Vendor: Apple Graphics Card: Apple M1 Pro

OpenGL Version: 4.1 Metal - 88.1

Window size: 1072x831 Font Size Adjustment: 96pt UI Scaling: 0.8 Draw distance: 128m Bandwidth: 10000kbit/s LOD factor: 1.375 Render quality: 3 Texture memory: 10922MB Disk cache: Max size 1638.4 MB (87.9% used) HiDPI display mode:

RestrainedLove API: (disabled) J2C Decoder Version: KDU v7.10.4 Audio Driver Version: OpenAL, version 1.1 ALSOFT 1.23.1 / OpenAL Community / OpenAL Soft: OpenAL Soft Dullahan: 1.14.0.202408091638 CEF: 118.4.1+g3dd6078+chromium-118.0.5993.54 Chromium: 118.0.5993.54 LibVLC Version: 3.0.21 Voice Server Version: Not Connected Packets Lost: 6/6862 (0.1%) October 16 2024 13:24:55

Description

When I type text into any input field in a recent build of the geenz/feat/legacy-alpha-params branch, which @Geenz has just pulled develop from, characters are randomly duplicated, like so:

HHii evveerybbooddyy! I'mm tyyping eexxttrra tooddaayy!

This appears to affect any input field (chat input, LSL editor, etc.). @AtlasLinden cannot reproduce the issue on Windows, so I suspect the issue is Mac-specific. It reproduces with my laptop's built-in keyboard or an Apple USB keyboard. I confirmed that the issue does not reproduce with Second Life Release 7.1.10.10800445603 (64bit).

Reproduction steps

  1. Launch the viewer
  2. In the username field, type something like '12345'

Expected results: '12345' should appear in the input field.

Actual results: '112233455' appears in the input field (or some variant thereof). The exact repeat count of each character varies with each attempt.

akleshchev commented 21 hours ago

Line editor LLLineEditor::handleUnicodeCharHere gets two calls, one from system and one from LLGameControl::processEvents

#0  0x00000001018d923f in LLLineEditor::handleUnicodeCharHere at /Users/akleshchev/ViewerContribute/indra/llui/lllineeditor.cpp:1675
#1  0x0000000101a77868 in LLView::handleUnicodeChar at /Users/akleshchev/ViewerContribute/indra/llui/llview.cpp:1061
#2  0x000000010125ebbb in LLViewerWindow::handleUnicodeChar at /Users/akleshchev/ViewerContribute/indra/newview/llviewerwindow.cpp:3136
#3  0x0000000101b187d7 in callUnicodeCallback at /Users/akleshchev/ViewerContribute/indra/llwindow/llwindowmacosx.cpp:262
#4  0x0000000101b11f2e in -[LLOpenGLView insertText:replacementRange:] at /Users/akleshchev/ViewerContribute/indra/llwindow/llopenglview-objc.mm:764
#5  0x00007ff8114f1513 in +[NSInputAnalytics(TrackedActionsManager) allowActionTrackingAnalyticsWithName:forAction:] ()
#6  0x00007ff811108bf9 in -[NSTextInputContext(NSInputContext_WithCompletion) insertText:replacementRange:completionHandler:] ()
#7  0x00007ff811cb298b in __55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke_2.365 ()
#8  0x00007ff811108b20 in -[NSTextInputContext do_HandleTSMEvent_insertFixLenTextLoop:whileCondition:dispatchWorkEach:afterEachInsertText:continuation:] ()
#9  0x00007ff8111089e7 in -[NSTextInputContext tryHandleTSMEvent_insertFixLenText_withContext:dispatchCondition:setupForDispatch:nestedWorkaroundCondition:nestedWorkaroundDispatchWork:loopCondition:dispatchWorkEach:afterEachInsertText:continuation:] ()
#10 0x00007ff811cb205a in __55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke.321 ()
#11 0x00007ff811108624 in __55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke_2 ()
#12 0x00007ff8111085a3 in -[NSTextInputContext tryHandleTSMEvent_HasMarkedText_withDispatchCondition:dispatchWork:continuation:] ()
#13 0x00007ff811107c24 in -[NSTextInputContext handleTSMEvent:completionHandler:] ()
#14 0x00007ff81110746b in _NSTSMEventHandler ()
#15 0x00007ff818cb60c7 in DispatchEventToHandlers ()
#16 0x00007ff818cb4143 in SendEventToEventTargetInternal ()
#17 0x00007ff818cb4302 in SendEventToEventTargetWithOptions ()
#18 0x00007ff818d58215 in SendTSMEvent_WithCompletionHandler ()
#19 0x00007ff818d5873b in __SendUnicodeTextAEToUnicodeDoc_WithCompletionHandler_block_invoke ()
#20 0x00007ff818d58ba2 in __SendFilterTextEvent_WithCompletionHandler_block_invoke ()
#21 0x00007ff818d58265 in SendTSMEvent_WithCompletionHandler ()
#22 0x00007ff818d58583 in SendFilterTextEvent_WithCompletionHandler ()
#23 0x00007ff818d552db in SendUnicodeTextAEToUnicodeDoc_WithCompletionHandler ()
#24 0x00007ff818d5943b in __utDeliverTSMEvent_WithCompletionHandler_block_invoke_2 ()
#25 0x00007ff818d592cb in __utDeliverTSMEvent_WithCompletionHandler_block_invoke ()
#26 0x00007ff818d54c30 in TSMKeyEvent_WithCompletionHandler ()
#27 0x00007ff818d62ade in __TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke_5 ()
#28 0x00007ff818d629d7 in __TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke_4 ()
#29 0x00007ff818d6280f in __TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke_3 ()
#30 0x00007ff818d62593 in __TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke_2 ()
#31 0x00007ff818d62302 in __TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke ()
#32 0x00007ff818d613f8 in TSMProcessRawKeyEventWithOptionsAndCompletionHandler ()
#33 0x00007ff811cb69fc in __84-[NSTextInputContext _handleEvent:options:allowingSyntheticEvent:completionHandler:]_block_invoke_3.956 ()
#34 0x00007ff811cb6759 in __204-[NSTextInputContext tryTSMProcessRawKeyEvent_orSubstitution:dispatchCondition:setupForDispatch:furtherCondition:doubleSpaceSubstitutionCondition:doubleSpaceSubstitutionWork:dispatchTSMWork:continuation:]_block_invoke.920 ()
#35 0x00007ff811105f95 in -[NSTextInputContext tryTSMProcessRawKeyEvent_orSubstitution:dispatchCondition:setupForDispatch:furtherCondition:doubleSpaceSubstitutionCondition:doubleSpaceSubstitutionWork:dispatchTSMWork:continuation:] ()
#36 0x00007ff8111059b6 in -[NSTextInputContext _handleEvent:options:allowingSyntheticEvent:completionHandler:] ()
#37 0x00007ff8111053d5 in -[NSTextInputContext _handleEvent:allowingSyntheticEvent:] ()
#38 0x0000000101b10ff9 in -[LLOpenGLView keyDown:] at /Users/akleshchev/ViewerContribute/indra/llwindow/llopenglview-objc.mm:523
#39 0x00007ff8110725bd in -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] ()
#40 0x00007ff811072255 in -[NSWindow(NSEventRouting) sendEvent:] ()
#41 0x00007ff811934f9a in -[NSApplication(NSEventRouting) sendEvent:] ()
#42 0x0000000100163917 in -[LLApplication sendEvent:] at /Users/akleshchev/ViewerContribute/indra/newview/llappdelegate-objc.mm:373
#43 0x000000010776b1a3 in ___lldb_unnamed_symbol4110 ()
#44 0x000000010776b42b in ___lldb_unnamed_symbol4112 ()
#45 0x000000010767055e in ___lldb_unnamed_symbol2415 ()
#46 0x000000010766fd15 in ___lldb_unnamed_symbol2414 ()
#47 0x0000000101b01528 in LLGameControl::processEvents at /Users/akleshchev/ViewerContribute/indra/llwindow/llgamecontrol.cpp:1630
#48 0x00000001001c50cc in LLAppViewer::doFrame at /Users/akleshchev/ViewerContribute/indra/newview/llappviewer.cpp:1538
#49 0x00000001001c4437 in LLAppViewer::frame at /Users/akleshchev/ViewerContribute/indra/newview/llappviewer.cpp:1424
#50 0x00000001001635ef in -[LLAppDelegate oneFrame] at /Users/akleshchev/ViewerContribute/indra/newview/llappdelegate-objc.mm:152
#0  0x00000001018d923f in LLLineEditor::handleUnicodeCharHere at /Users/akleshchev/ViewerContribute/indra/llui/lllineeditor.cpp:1675
#1  0x0000000101a77868 in LLView::handleUnicodeChar at /Users/akleshchev/ViewerContribute/indra/llui/llview.cpp:1061
#2  0x000000010125ebbb in LLViewerWindow::handleUnicodeChar at /Users/akleshchev/ViewerContribute/indra/newview/llviewerwindow.cpp:3136
#3  0x0000000101b187d7 in callUnicodeCallback at /Users/akleshchev/ViewerContribute/indra/llwindow/llwindowmacosx.cpp:262
#4  0x0000000101b11f2e in -[LLOpenGLView insertText:replacementRange:] at /Users/akleshchev/ViewerContribute/indra/llwindow/llopenglview-objc.mm:764
#5  0x00007ff8114f1513 in +[NSInputAnalytics(TrackedActionsManager) allowActionTrackingAnalyticsWithName:forAction:] ()
#6  0x00007ff811108bf9 in -[NSTextInputContext(NSInputContext_WithCompletion) insertText:replacementRange:completionHandler:] ()
#7  0x00007ff811cb298b in __55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke_2.365 ()
#8  0x00007ff811108b20 in -[NSTextInputContext do_HandleTSMEvent_insertFixLenTextLoop:whileCondition:dispatchWorkEach:afterEachInsertText:continuation:] ()
#9  0x00007ff8111089e7 in -[NSTextInputContext tryHandleTSMEvent_insertFixLenText_withContext:dispatchCondition:setupForDispatch:nestedWorkaroundCondition:nestedWorkaroundDispatchWork:loopCondition:dispatchWorkEach:afterEachInsertText:continuation:] ()
#10 0x00007ff811cb205a in __55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke.321 ()
#11 0x00007ff811108624 in __55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke_2 ()
#12 0x00007ff8111085a3 in -[NSTextInputContext tryHandleTSMEvent_HasMarkedText_withDispatchCondition:dispatchWork:continuation:] ()
#13 0x00007ff811107c24 in -[NSTextInputContext handleTSMEvent:completionHandler:] ()
#14 0x00007ff81110746b in _NSTSMEventHandler ()
#15 0x00007ff818cb60c7 in DispatchEventToHandlers ()
#16 0x00007ff818cb4143 in SendEventToEventTargetInternal ()
#17 0x00007ff818cb4302 in SendEventToEventTargetWithOptions ()
#18 0x00007ff818d58215 in SendTSMEvent_WithCompletionHandler ()
#19 0x00007ff818d5873b in __SendUnicodeTextAEToUnicodeDoc_WithCompletionHandler_block_invoke ()
#20 0x00007ff818d58ba2 in __SendFilterTextEvent_WithCompletionHandler_block_invoke ()
#21 0x00007ff818d58265 in SendTSMEvent_WithCompletionHandler ()
#22 0x00007ff818d58583 in SendFilterTextEvent_WithCompletionHandler ()
#23 0x00007ff818d552db in SendUnicodeTextAEToUnicodeDoc_WithCompletionHandler ()
#24 0x00007ff818d5943b in __utDeliverTSMEvent_WithCompletionHandler_block_invoke_2 ()
#25 0x00007ff818d592cb in __utDeliverTSMEvent_WithCompletionHandler_block_invoke ()
#26 0x00007ff818d54c30 in TSMKeyEvent_WithCompletionHandler ()
#27 0x00007ff818d62ade in __TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke_5 ()
#28 0x00007ff818d629d7 in __TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke_4 ()
#29 0x00007ff818d6280f in __TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke_3 ()
#30 0x00007ff818d62593 in __TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke_2 ()
#31 0x00007ff818d62302 in __TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke ()
#32 0x00007ff818d613f8 in TSMProcessRawKeyEventWithOptionsAndCompletionHandler ()
#33 0x00007ff811cb69fc in __84-[NSTextInputContext _handleEvent:options:allowingSyntheticEvent:completionHandler:]_block_invoke_3.956 ()
#34 0x00007ff811cb6759 in __204-[NSTextInputContext tryTSMProcessRawKeyEvent_orSubstitution:dispatchCondition:setupForDispatch:furtherCondition:doubleSpaceSubstitutionCondition:doubleSpaceSubstitutionWork:dispatchTSMWork:continuation:]_block_invoke.920 ()
#35 0x00007ff811105f95 in -[NSTextInputContext tryTSMProcessRawKeyEvent_orSubstitution:dispatchCondition:setupForDispatch:furtherCondition:doubleSpaceSubstitutionCondition:doubleSpaceSubstitutionWork:dispatchTSMWork:continuation:] ()
#36 0x00007ff8111059b6 in -[NSTextInputContext _handleEvent:options:allowingSyntheticEvent:completionHandler:] ()
#37 0x00007ff8111053d5 in -[NSTextInputContext _handleEvent:allowingSyntheticEvent:] ()
#38 0x0000000101b10ff9 in -[LLOpenGLView keyDown:] at /Users/akleshchev/ViewerContribute/indra/llwindow/llopenglview-objc.mm:523
#39 0x00007ff8110725bd in -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] ()
#40 0x00007ff811072255 in -[NSWindow(NSEventRouting) sendEvent:] ()
#41 0x00007ff811934f9a in -[NSApplication(NSEventRouting) sendEvent:] ()
#42 0x0000000100163917 in -[LLApplication sendEvent:] at /Users/akleshchev/ViewerContribute/indra/newview/llappdelegate-objc.mm:373
#43 0x00007ff8114adf41 in -[NSApplication _handleEvent:] ()