summaryrefslogtreecommitdiff
path: root/vcl/osx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-08-15 08:23:31 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2017-08-22 15:01:41 +0200
commit33b094a8949c34756c593bfad52450ec2b7daa54 (patch)
tree1d3928d6c0227527e8269d8d19605c825f4b5eef /vcl/osx
parente4000dbe27ba65146854f02c9affb45e22f6639f (diff)
OSX fix updates during resize
While resizing MacOS suspends the NSDefaultRunLoopMode. So in this caae we can't post to the system event loop, but must use timers to restart ourself. Since the timer itself is scheduled on the NSEventTrackingRunLoopMode it' also triggers on resize events. There is still some minor glitch: when resizing too fast some part of LibreOffice isn't painted, while the left mouse button is down. Since there isn't any layouting triggered by the mouse up, there has to be an other inconsistency. Change-Id: I3ccba78bd23ec8526f21e7b93b027f3d3279f901
Diffstat (limited to 'vcl/osx')
-rw-r--r--vcl/osx/salframeview.mm11
-rw-r--r--vcl/osx/salinst.cxx1
-rw-r--r--vcl/osx/salnstimer.mm8
-rw-r--r--vcl/osx/saltimer.cxx4
4 files changed, 21 insertions, 3 deletions
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index e290891ce294..a20f3b7a6e5a 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -533,6 +533,17 @@ private:
-(void)drawRect: (NSRect)aRect
{
+ if( GetSalData()->mpFirstInstance )
+ {
+ const bool bIsLiveResize = [self inLiveResize];
+ const bool bWasLiveResize = GetSalData()->mpFirstInstance->mbIsLiveResize;
+ if ( bWasLiveResize != bIsLiveResize )
+ {
+ GetSalData()->mpFirstInstance->mbIsLiveResize = bIsLiveResize;
+ Scheduler::ProcessTaskScheduling();
+ }
+ }
+
// HOTFIX: #i93512# prevent deadlocks if any other thread already has the SalYieldMutex
TryGuard aTryGuard;
if( !aTryGuard.IsGuarded() )
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 54e04dad76ca..e16e73945c2d 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -347,6 +347,7 @@ void DestroySalInstance( SalInstance* pInst )
AquaSalInstance::AquaSalInstance()
: maUserEventListMutex()
, maWaitingYieldCond()
+ , mbIsLiveResize( false )
{
mpSalYieldMutex = new SalYieldMutex;
mpSalYieldMutex->acquire();
diff --git a/vcl/osx/salnstimer.mm b/vcl/osx/salnstimer.mm
index c9867cf7a79e..c9b657dcd776 100644
--- a/vcl/osx/salnstimer.mm
+++ b/vcl/osx/salnstimer.mm
@@ -30,7 +30,13 @@
-(void)timerElapsed:(NSTimer*)pTimer
{
(void)pTimer;
- ImplNSAppPostEvent( AquaSalInstance::DispatchTimerEvent, YES );
+ // nil the timer, as it is just invalidated after the firing function
+ AquaSalTimer::pRunningTimer = nil;
+ const AquaSalInstance *pInst = GetSalData()->mpFirstInstance;
+ if (pInst->mbIsLiveResize)
+ AquaSalTimer::handleDispatchTimerEvent();
+ else
+ ImplNSAppPostEvent( AquaSalInstance::DispatchTimerEvent, YES );
}
@end
diff --git a/vcl/osx/saltimer.cxx b/vcl/osx/saltimer.cxx
index 3cf74529a301..e442fcf05335 100644
--- a/vcl/osx/saltimer.cxx
+++ b/vcl/osx/saltimer.cxx
@@ -83,7 +83,7 @@ static void ImplSalStartTimer( sal_uLong nMS )
return;
}
- if ( 0 == nMS )
+ if ( 0 == nMS && !pSalData->mpFirstInstance->mbIsLiveResize )
{
ImplSalStopTimer();
ImplNSAppPostEvent( AquaSalInstance::DispatchTimerEvent, NO );
@@ -93,7 +93,7 @@ static void ImplSalStartTimer( sal_uLong nMS )
NSTimeInterval aTI = double(nMS) / 1000.0;
if( AquaSalTimer::pRunningTimer != nil )
{
- if (rtl::math::approxEqual(
+ if ([AquaSalTimer::pRunningTimer isValid] && rtl::math::approxEqual(
[AquaSalTimer::pRunningTimer timeInterval], aTI))
{
// set new fire date