diff options
author | Patrick Luby <plubius@neooffice.org> | 2023-11-06 09:44:18 -0500 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-11-20 17:55:28 +0100 |
commit | b8910f2a00119e2de136b00567d5f9704f84ac25 (patch) | |
tree | 81f6a6eab9377dedd4de3d951da232eda9949992 | |
parent | 045bef390a025c3615d904524bf5ee21fa697ca4 (diff) |
tdf#155266 force flush after scrolling
This is the second attempt to force a flush after scrolling.
Commit 9c0803edd1f42b2d29115674795c7c674fea1a35 worked on
Mac Silicon but not Mac Intel.
So, instead of calling [NSApp currentEvent] to determine if
scrolling has occurred, mark the AquaSalFrame whenever a
scrollwheel or mouse drag event is dispatched so the frame
will be flushed in the next AquaSalFrame::Flush() call.
Change-Id: I2d0b99d2cd1167e92c7fd89bf53b2f30ab85a165
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159003
Tested-by: Jenkins
Reviewed-by: Patrick Luby <plubius@neooffice.org>
(cherry picked from commit 0c54c09aeb7e170512195c8f619ab2ded98c1ec5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159038
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | vcl/inc/osx/salframe.h | 3 | ||||
-rw-r--r-- | vcl/osx/salframe.cxx | 9 | ||||
-rw-r--r-- | vcl/osx/salframeview.mm | 7 |
3 files changed, 16 insertions, 3 deletions
diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h index af8783b96147..b79d317ad55f 100644 --- a/vcl/inc/osx/salframe.h +++ b/vcl/inc/osx/salframe.h @@ -98,6 +98,9 @@ public: int mnBlinkCursorDelay; + // tdf#155266 force flush after scrolling + bool mbForceFlush; + public: /** Constructor diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index d3d35de8577f..88c9a9dcb06f 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -87,7 +87,8 @@ AquaSalFrame::AquaSalFrame( SalFrame* pParent, SalFrameStyleFlags salFrameStyle mnTrackingRectTag( 0 ), mrClippingPath( nullptr ), mnICOptions( InputContextFlags::NONE ), - mnBlinkCursorDelay ( nMinBlinkCursorDelay ) + mnBlinkCursorDelay( nMinBlinkCursorDelay ), + mbForceFlush( false ) { mpParent = dynamic_cast<AquaSalFrame*>(pParent); @@ -1015,8 +1016,9 @@ void AquaSalFrame::Flush() // outside of the application's event loop (e.g. IntroWindow) // nothing would trigger paint event handling // => fall back to synchronous painting - if( ImplGetSVData()->maAppData.mnDispatchLevel <= 0 ) + if( mbForceFlush || ImplGetSVData()->maAppData.mnDispatchLevel <= 0 ) { + mbForceFlush = false; mpGraphics->Flush(); [mpNSView display]; } @@ -1036,8 +1038,9 @@ void AquaSalFrame::Flush( const tools::Rectangle& rRect ) // outside of the application's event loop (e.g. IntroWindow) // nothing would trigger paint event handling // => fall back to synchronous painting - if( ImplGetSVData()->maAppData.mnDispatchLevel <= 0 ) + if( mbForceFlush || ImplGetSVData()->maAppData.mnDispatchLevel <= 0 ) { + mbForceFlush = false; mpGraphics->Flush( rRect ); [mpNSView display]; } diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm index 08821800f5a9..3892ef659cf2 100644 --- a/vcl/osx/salframeview.mm +++ b/vcl/osx/salframeview.mm @@ -786,6 +786,10 @@ static AquaSalFrame* getMouseContainerFrame() aEvent.mnX = pDispatchFrame->maGeometry.width() - 1 - aEvent.mnX; pDispatchFrame->CallCallback( nEvent, &aEvent ); + + // tdf#155266 force flush after scrolling + if (nButton == MOUSE_LEFT && nEvent == SalEvent::MouseMove) + mpFrame->mbForceFlush = true; } } @@ -1089,6 +1093,9 @@ static AquaSalFrame* getMouseContainerFrame() mpFrame->CallCallback( SalEvent::WheelMouse, &aEvent ); } + + // tdf#155266 force flush after scrolling + mpFrame->mbForceFlush = true; } } |