vcl/osx/salinst.cxx |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

New commits:
commit 92815f3a464b447898ecf52492247335228e4a72
Author:     Patrick Luby <guibmac...@gmail.com>
AuthorDate: Tue May 7 17:41:10 2024 -0400
Commit:     Patrick Luby <guibomac...@gmail.com>
CommitDate: Wed May 8 01:39:44 2024 +0200

    tdf#160767 skip fix for tdf#155266 when the event hasn't changed
    
    When scrolling in Writer with automatic spellchecking enabled,
    the current event never changes because the fix for tdf#155266
    causes Writer to get stuck in a loop. So, if the current event
    has not changed since the last pass through this code, skip
    the fix for tdf#155266.
    
    Change-Id: I97265a7698756c5fb65b6686f6bb77c1caa08862
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167298
    Reviewed-by: Patrick Luby <guibomac...@gmail.com>
    Tested-by: Jenkins

diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index db2b2c605677..e8543fcda19c 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -750,7 +750,22 @@ bool AquaSalInstance::AnyInput( VclInputFlags nType )
         // not NSEventTypeScrollWheel.
         NSEvent* pCurrentEvent = [NSApp currentEvent];
         if( pCurrentEvent && [pCurrentEvent type] == NSEventTypeScrollWheel )
-            nEventMask &= ~NSEventMaskScrollWheel;
+        {
+            // tdf#160767 skip fix for tdf#155266 when the event hasn't changed
+            // When scrolling in Writer with automatic spellchecking enabled,
+            // the current event never changes because the fix for tdf#155266
+            // causes Writer to get stuck in a loop. So, if the current event
+            // has not changed since the last pass through this code, skip
+            // the fix for tdf#155266.
+            static NSEvent *pLastCurrentEvent = nil;
+            if( pLastCurrentEvent != pCurrentEvent )
+            {
+                if( pLastCurrentEvent )
+                    [pLastCurrentEvent release];
+                pLastCurrentEvent = [pCurrentEvent retain];
+                nEventMask &= ~NSEventMaskScrollWheel;
+            }
+        }
     }
 
     if( nType & VclInputFlags::KEYBOARD)

Reply via email to