summaryrefslogtreecommitdiff
path: root/vcl/osx/salinst.cxx
diff options
context:
space:
mode:
authorPatrick Luby <plubius@neooffice.org>2023-01-08 14:41:24 -0500
committerPatrick Luby <plubius@neooffice.org>2023-01-13 14:10:00 +0000
commitfed429e4f6f437997aa6a88e2d071f58aa00ee34 (patch)
tree0723aaf6f5e4698fbab4ce4bd368ad00e997c070 /vcl/osx/salinst.cxx
parent1a79594a27f41ad369e7c387c51e00afb1352872 (diff)
Related: tdf#152703 Eliminate potential blocking during live resize
Some events and timers call Application::Reschedule() or Application::Yield() so don't block and wait for events when a window is in live resize. Also, only native events and timers need to be dispatched to redraw the window so skip dispatching user events when a window is in live resize. Lastly, only higher priority tasks need to be fired to redraw the window so skip firing potentially long-running tasks, such as the Writer idle layout timer, when a window is in live resize. Change-Id: I5d449caa432399e836b8e59781e5cc53af718873 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145211 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
Diffstat (limited to 'vcl/osx/salinst.cxx')
-rw-r--r--vcl/osx/salinst.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 48289e2a0165..f2ba3b59fb25 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -368,7 +368,6 @@ VCLPLUG_OSX_PUBLIC SalInstance* create_SalInstance()
AquaSalInstance::AquaSalInstance()
: SalInstance(std::make_unique<SalYieldMutex>())
, mnActivePrintJobs( 0 )
- , mbIsLiveResize( false )
, mbNoYieldLock( false )
, mbTimerProcessed( false )
{
@@ -556,6 +555,13 @@ static bool isWakeupEvent( NSEvent *pEvent )
bool AquaSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents)
{
+ // Related: tdf#152703 Eliminate potential blocking during live resize
+ // Some events and timers call Application::Reschedule() or
+ // Application::Yield() so don't block and wait for events when a
+ // window is in live resize
+ if ( ImplGetSVData()->mpWinData->mbIsLiveResize )
+ bWait = false;
+
// ensure that the per thread autorelease pool is top level and
// will therefore not be destroyed by cocoa implicitly
SalData::ensureThreadAutoreleasePool();
@@ -565,7 +571,11 @@ bool AquaSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents)
ReleasePoolHolder aReleasePool;
// first, process current user events
- bool bHadEvent = DispatchUserEvents( bHandleAllCurrentEvents );
+ // Related: tdf#152703 Eliminate potential blocking during live resize
+ // Only native events and timers need to be dispatched to redraw
+ // the window so skip dispatching user events when a window is in
+ // live resize
+ bool bHadEvent = ( !ImplGetSVData()->mpWinData->mbIsLiveResize && DispatchUserEvents( bHandleAllCurrentEvents ) );
if ( !bHandleAllCurrentEvents && bHadEvent )
return true;