summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-10-14 01:43:07 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2017-10-16 16:05:19 +0200
commitc69c1ee9d1305c284be48a7a973810da16c15541 (patch)
treedd535082f817ea79311b278cb7c1a3849d2b86b1 /vcl
parentbcccdc71cb363760c6b0899fd13dee4203ec8711 (diff)
tdf#112076 OSX post timeout after shouldCloseWindow
It seems that something filters application defined events when closing a window... DoYield expects a timeout event, which never arrives, stopping all redraw and generating a busy loop. Change-Id: Ic83468cceac7b967acaecf18b321178fc7565b94 Reviewed-on: https://gerrit.libreoffice.org/43381 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/README.scheduler4
-rw-r--r--vcl/inc/osx/saltimer.h1
-rw-r--r--vcl/osx/salframeview.mm3
-rw-r--r--vcl/osx/saltimer.cxx8
4 files changed, 16 insertions, 0 deletions
diff --git a/vcl/README.scheduler b/vcl/README.scheduler
index 566a88629301..17648ae3b439 100644
--- a/vcl/README.scheduler
+++ b/vcl/README.scheduler
@@ -170,6 +170,10 @@ There is also a workaround for a problem for pushing tasks to an empty queue,
as [NSApp postEvent: ... atStart: NO] doesn't append the event, if the
message queue is empty.
+An additional problem is the filtering of events on Window close. This drops
+posted timer events, when a Window is closed resulting in a busy DoYield loop,
+so we have to re-post the event, after closing a window.
+
== Windows implementation details ==
Posted or sent event messages often trigger processing of WndProc in
diff --git a/vcl/inc/osx/saltimer.h b/vcl/inc/osx/saltimer.h
index 65247b930cfa..c860ad5cbdda 100644
--- a/vcl/inc/osx/saltimer.h
+++ b/vcl/inc/osx/saltimer.h
@@ -58,6 +58,7 @@ public:
void handleStartTimerEvent( NSEvent* pEvent );
void handleDispatchTimerEvent( NSEvent* pEvent );
void handleTimerElapsed();
+ void handleWindowShouldClose();
bool IsTimerElapsed() const;
};
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 1f0a3690bb70..c0d28fe4bc3f 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -369,6 +369,9 @@ static AquaSalFrame* getMouseContainerFrame()
{
mpFrame->CallCallback( SalEvent::Close, nullptr );
bRet = NO; // application will close the window or not, AppKit shouldn't
+ AquaSalTimer *pTimer = static_cast<AquaSalTimer*>( ImplGetSVData()->maSchedCtx.mpSalTimer );
+ assert( pTimer );
+ pTimer->handleWindowShouldClose();
}
}
diff --git a/vcl/osx/saltimer.cxx b/vcl/osx/saltimer.cxx
index 877fdfae85b5..3226b1d1f9ec 100644
--- a/vcl/osx/saltimer.cxx
+++ b/vcl/osx/saltimer.cxx
@@ -196,4 +196,12 @@ AquaSalTimer::~AquaSalTimer()
Stop();
}
+void AquaSalTimer::handleWindowShouldClose()
+{
+ // for whatever reason events get filtered on close, presumely by
+ // timestamp so post a new timeout event, if there was one queued...
+ if ( ExistsValidEvent() && !m_pRunningTimer )
+ queueDispatchTimerEvent( NO );
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */