diff --git a/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoascreen.h b/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoascreen.h index c929cc6..1c88447 100644 --- a/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoascreen.h +++ b/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoascreen.h @@ -112,13 +112,13 @@ private: QRect m_geometry; QRect m_availableGeometry; QDpi m_logicalDpi; - qreal m_refreshRate = 0; - int m_depth = 0; + qreal m_refreshRate; + int m_depth; QString m_name; QImage::Format m_format; QSizeF m_physicalSize; QCocoaCursor *m_cursor; - qreal m_devicePixelRatio = 0; + qreal m_devicePixelRatio; CVDisplayLinkRef m_displayLink = nullptr; dispatch_source_t m_displayLinkSource = nullptr; diff --git a/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoascreen.mm b/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoascreen.mm index e4dd4cf..a66483c 100644 --- a/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoascreen.mm +++ b/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoascreen.mm @@ -471,6 +471,15 @@ void QCocoaScreen::deliverUpdateRequests() // it on the main thread yet, because the processing of the update request is taking // too long, or because the update request was deferred due to window live resizing. qDeferredDebug(screenUpdates) << ", " << framesAheadOfDelivery << " frame(s) ahead"; + + // We skip the frame completely if we're live-resizing, to not put any extra + // strain on the main thread runloop. Otherwise we assume we should push frames + // as fast as possible, and hopefully the callback will be delivered on the + // main thread just when the previous finished. + if (qt_apple_sharedApplication().keyWindow.inLiveResize) { + qDeferredDebug(screenUpdates) << "; waiting for main thread to catch up"; + return; + } } qDeferredDebug(screenUpdates) << "; signaling dispatch source";