summaryrefslogtreecommitdiff
path: root/vcl/osx/salinst.cxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-11-16 20:59:58 +0000
committerMichael Meeks <michael.meeks@collabora.com>2015-11-17 09:20:58 +0000
commiteca4c54e52363f80db26e228e586aeb7732c7100 (patch)
treef96c872d02d15044279c5c49097aa8ea70a8f967 /vcl/osx/salinst.cxx
parent2ee802245ed9614734506a9d46edcbcee53ea2cc (diff)
vcl: add parameter to detect if OS events are processed during Yield.
Intended as a non-functional change. Change-Id: I1915aad03786540da1a4bfe9031d33f2c2a9b4e3 Reviewed-on: https://gerrit.libreoffice.org/20006 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl/osx/salinst.cxx')
-rw-r--r--vcl/osx/salinst.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index b4c4eec621f6..f2afec8c71d6 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -559,10 +559,11 @@ class ReleasePoolHolder
~ReleasePoolHolder() { [mpPool release]; }
};
-void AquaSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong const nReleased)
+bool AquaSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong const nReleased)
{
(void) nReleased;
assert(nReleased == 0); // not implemented
+
// ensure that the per thread autorelease pool is top level and
// will therefore not be destroyed by cocoa implicitly
SalData::ensureThreadAutoreleasePool();
@@ -599,12 +600,13 @@ void AquaSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLon
osl_setCondition( maWaitingYieldCond );
// return if only one event is asked for
if( ! bHandleAllCurrentEvents )
- return;
+ return true;
}
}
// handle cocoa event queue
// cocoa events may be only handled in the thread the NSApp was created
+ bool bHadEvent = false;
if( isNSAppThread() && mnActivePrintJobs == 0 )
{
// we need to be woken up by a cocoa-event
@@ -614,7 +616,6 @@ void AquaSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLon
// handle available events
NSEvent* pEvent = nil;
- bool bHadEvent = false;
do
{
sal_uLong nCount = ReleaseYieldMutex();
@@ -709,6 +710,8 @@ void AquaSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLon
bInAppEvent = false;
}
}
+
+ return bHadEvent;
}
bool AquaSalInstance::AnyInput( VclInputFlags nType )