summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorPatrick Luby <plubius@neooffice.org>2023-11-02 20:05:21 -0400
committerPatrick Luby <plubius@neooffice.org>2023-11-03 20:55:04 +0100
commit9c0803edd1f42b2d29115674795c7c674fea1a35 (patch)
tree7547e3cac8fd59b0aa48f5a8de63e480934617b1 /vcl
parente4821ce3e0eb814f8942b9451183b4589e901ec3 (diff)
tdf#155266 flush when scrolling or dragging
Delaying flushing until the dispatch level returns to zero causes scrolling via the scrollwheel or mouse drag to appear laggy and jerky. Change-Id: Ib70e7766435baa765dd0d1d704ba2fac87f7fccc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158853 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/osx/salframe.cxx38
1 files changed, 36 insertions, 2 deletions
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index d20e6e3d8422..211b288f3b79 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1018,7 +1018,24 @@ 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 )
+ bool bFlush = ( ImplGetSVData()->maAppData.mnDispatchLevel <= 0 );
+
+ // tdf#155266 flush when scrolling or dragging
+ // Delaying flushing until the dispatch level returns to zero causes
+ // scrolling via the scrollwheel or mouse drag to appear laggy and
+ // jerky.
+ if( !bFlush )
+ {
+ NSEvent *pEvent = [NSApp currentEvent];
+ if ( pEvent )
+ {
+ NSEventType nType = [pEvent type];
+ if ( nType == NSEventTypeScrollWheel || nType == NSEventTypeLeftMouseDragged )
+ bFlush = true;
+ }
+ }
+
+ if( bFlush )
{
mpGraphics->Flush();
[mpNSView display];
@@ -1039,7 +1056,24 @@ 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 )
+ bool bFlush = ( ImplGetSVData()->maAppData.mnDispatchLevel <= 0 );
+
+ // tdf#155266 flush when scrolling or dragging
+ // Delaying flushing until the dispatch level returns to zero causes
+ // scrolling via the scrollwheel or mouse drag to appear laggy and
+ // jerky.
+ if( !bFlush )
+ {
+ NSEvent *pEvent = [NSApp currentEvent];
+ if ( pEvent )
+ {
+ NSEventType nType = [pEvent type];
+ if ( nType == NSEventTypeScrollWheel || nType == NSEventTypeLeftMouseDragged )
+ bFlush = true;
+ }
+ }
+
+ if( bFlush )
{
mpGraphics->Flush( rRect );
[mpNSView display];