summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2014-05-15 23:14:58 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-06-03 17:25:36 +0200
commit9e02f9cf085386f44045e5991a39c05acb660b5b (patch)
treec2e718e04273e77c2abec82774667a8d9be693e7 /src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
parent365cd4adeb7c8719d438ff2438c1db5726c90c54 (diff)
Cocoa: Make QMacNativeWidget event processing work
Don't interrupt the Qt event loop if the Qt event loop isn't running (meaning processEvents has not/ will not be called). This can happen in the QMacNativeWidget or plugin case where the native code calls [NSApp run] and QApplication::exec() is never called. In Qt 4 this was not necessary since UI event processing was more direct: QCocoaView would call QCoreApplication::sendMouseEvent/sendSpontaneousEvent directly on mouse events. Task-number: QTBUG-36225 Change-Id: I2894cbbca66a902652c9f8bc916e94ad8ce0e18e Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
index 9aaf08adcf..45c0714b6b 100644
--- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
+++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
@@ -870,7 +870,7 @@ void QCocoaEventDispatcherPrivate::processPostedEvents()
return;
}
- if (interrupt) {
+ if (processEventsCalled > 0 && interrupt) {
if (currentExecIsNSAppRun) {
// The event dispatcher has been interrupted. But since
// [NSApplication run] is running the event loop, we