diff options
author | Patrick Luby <plubius@neooffice.org> | 2023-01-02 19:53:46 -0500 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-03 07:12:20 +0000 |
commit | d118be7ed4dd6596a8b4d766e8507b6dcaf2b7f7 (patch) | |
tree | 2ed3dfdec07cb301067b1773e44f26791273e79b /vcl/osx | |
parent | ff7e00e12ff80bd708f31a1d886d000907ceb31a (diff) |
Related: tdf#152703 Eliminate empty window with Skia/Metal while resizing
The window will clear its background in [SalFrameWindow displayIfNeeded]
so when Skia/Metal is enabled, explicitly flush the Skia graphics to the
window during live resizing or else nothing will be drawn until after live
resizing has ended.
Also, when Skia/Metal is enabled, rapidly resizing a window has a noticeable
amount of flicker so don't send any paint events during live resizing. Also,
it appears that most of the LibreOffice layouts do not change their layout
much during live resizing so apply this change when Skia is not enabled to
ensure consistent behavior whether Skia is enabled or not.
Change-Id: If6423faa72529b9de8735e04e69c9511aceb2276
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144979
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/osx')
-rw-r--r-- | vcl/osx/salframeview.mm | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm index 2f35d3a057b7..de996654bc1d 100644 --- a/vcl/osx/salframeview.mm +++ b/vcl/osx/salframeview.mm @@ -36,6 +36,10 @@ #include <quartz/salgdi.h> #include <quartz/utils.h> +#if HAVE_FEATURE_SKIA +#include <vcl/skia/SkiaHelper.hxx> +#endif + #define WHEEL_EVENT_FACTOR 1.5 static sal_uInt16 ImplGetModifierMask( unsigned int nMask ) @@ -215,6 +219,21 @@ static AquaSalFrame* getMouseContainerFrame() if( GetSalData() && GetSalData()->mpInstance ) { SolarMutexGuard aGuard; + +#if HAVE_FEATURE_SKIA + // Related: tdf#152703 Eliminate empty window with Skia/Metal while resizing + // The window will clear its background so when Skia/Metal is enabled, + // explicitly flush the Skia graphics to the window during live + // resizing or else nothing will be drawn until after live resizing + // has ended. + if ( [self inLiveResize] && SkiaHelper::isVCLSkiaEnabled() && mpFrame && AquaSalFrame::isAlive( mpFrame ) ) + { + AquaSalGraphics* pGraphics = mpFrame->mpGraphics; + if ( pGraphics ) + pGraphics->Flush(); + } +#endif + [super displayIfNeeded]; } } @@ -317,7 +336,17 @@ static AquaSalFrame* getMouseContainerFrame() { mpFrame->UpdateFrameGeometry(); mpFrame->CallCallback( SalEvent::Resize, nullptr ); - mpFrame->SendPaintEvent(); + + // Related: tdf#152703 Stop flicker with Skia/Metal while resizing + // When Skia/Metal is enabled, rapidly resizing a window has a + // noticeable amount of flicker so don't send any paint events during + // live resizing. + // Also, it appears that most of the LibreOffice layouts do not change + // their layout much during live resizing so apply this change when + // Skia is not enabled to ensure consistent behavior whether Skia is + // enabled or not. + if ( ![self inLiveResize] ) + mpFrame->SendPaintEvent(); } } |