From 9e02f9cf085386f44045e5991a39c05acb660b5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Thu, 15 May 2014 23:14:58 +0200 Subject: Cocoa: Make QMacNativeWidget event processing work MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins') 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 -- cgit v1.2.3