vcl/osx/salframeview.mm |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit ef57aeb9ed190e18ebc034b9a45e190aea3f8f1d
Author:     Patrick Luby <guibmac...@gmail.com>
AuthorDate: Fri Feb 23 17:45:19 2024 -0500
Commit:     Patrick Luby <guibomac...@gmail.com>
CommitDate: Sat Feb 24 02:09:42 2024 +0100

    tdf#158124 KEY_DELETE events do not need an ExtTextInput event
    
    When using various Japanese input methods, the last event will be a
    repeating key down event with a single delete character while the
    Backspace key, Delete key, or Fn-Delete keys are pressed. These key
    events are now ignored since setting mbTextInputWantsNonRepeatKeyDown
    to YES for these events will trigger an assert or crash when saving a
    .docx document.
    
    Change-Id: If3762fcf41aa82bf4aa5dc7d1f15c1d282c86f99
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163875
    Tested-by: Jenkins
    Reviewed-by: Patrick Luby <guibomac...@gmail.com>

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 995eeb574999..dba377899838 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -2062,7 +2062,15 @@ static void updateWinDataInLiveResize(bool bInLiveResize)
     // and then dispatch a SalEvent::EndExtTextInput event.
     NSString *pNewMarkedText = nullptr;
     NSString *pChars = [mpLastEvent characters];
-    bool bNeedsExtTextInput = ( pChars && mbInKeyInput && !mpLastMarkedText && 
mpLastEvent && [mpLastEvent type] == NSEventTypeKeyDown && [mpLastEvent 
isARepeat] );
+
+    // tdf#158124 KEY_DELETE events do not need an ExtTextInput event
+    // When using various Japanese input methods, the last event will be a
+    // repeating key down event with a single delete character while the
+    // Backspace key, Delete key, or Fn-Delete keys are pressed. These key
+    // events are now ignored since setting mbTextInputWantsNonRepeatKeyDown
+    // to YES for these events will trigger an assert or crash when saving a
+    // .docx document.
+    bool bNeedsExtTextInput = ( pChars && mbInKeyInput && !mpLastMarkedText && 
mpLastEvent && [mpLastEvent type] == NSEventTypeKeyDown && [mpLastEvent 
isARepeat] && ImplMapKeyCode( [mpLastEvent keyCode] ) != KEY_DELETE );
     if ( bNeedsExtTextInput )
     {
         // tdf#154708 Preserve selection for repeating Shift-arrow on Japanese 
keyboard
  • core.git: vcl/osx Stephan Bergmann (via logerrit)
    • core.git: vcl/osx Patrick Luby (via logerrit)

Reply via email to