This commit is contained in:
kleuter 2019-11-30 10:27:58 +01:00
parent 6cf3527708
commit d7048c2056
2 changed files with 12 additions and 3 deletions

View File

@ -112,13 +112,13 @@ private:
QRect m_geometry; QRect m_geometry;
QRect m_availableGeometry; QRect m_availableGeometry;
QDpi m_logicalDpi; QDpi m_logicalDpi;
qreal m_refreshRate = 0; qreal m_refreshRate;
int m_depth = 0; int m_depth;
QString m_name; QString m_name;
QImage::Format m_format; QImage::Format m_format;
QSizeF m_physicalSize; QSizeF m_physicalSize;
QCocoaCursor *m_cursor; QCocoaCursor *m_cursor;
qreal m_devicePixelRatio = 0; qreal m_devicePixelRatio;
CVDisplayLinkRef m_displayLink = nullptr; CVDisplayLinkRef m_displayLink = nullptr;
dispatch_source_t m_displayLinkSource = nullptr; dispatch_source_t m_displayLinkSource = nullptr;

View File

@ -471,6 +471,15 @@ void QCocoaScreen::deliverUpdateRequests()
// it on the main thread yet, because the processing of the update request is taking // 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. // too long, or because the update request was deferred due to window live resizing.
qDeferredDebug(screenUpdates) << ", " << framesAheadOfDelivery << " frame(s) ahead"; 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"; qDeferredDebug(screenUpdates) << "; signaling dispatch source";