Windows: Silence warnings about BitBlt() failing.

After showing the lock screen, spurious warnings about BitBlt()
failing occur with last error set to ERROR_SUCCESS or
ERROR_INVALID_HANDLE.

Task-number: QTBUG-35926
Task-number: QTBUG-29716

Change-Id: I3e899cdf1ae60e76d13b81caec43716ad7c9725d
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Friedemann Kleint 2014-01-14 12:09:55 +01:00 committed by The Qt Project
parent 1949a8c003
commit 1cf5cd34f7

View File

@ -117,8 +117,11 @@ void QWindowsBackingStore::flush(QWindow *window, const QRegion &region,
}
if (!BitBlt(dc, br.x(), br.y(), br.width(), br.height(),
m_image->hdc(), br.x() + offset.x(), br.y() + offset.y(), SRCCOPY))
qErrnoWarning("%s: BitBlt failed", __FUNCTION__);
m_image->hdc(), br.x() + offset.x(), br.y() + offset.y(), SRCCOPY)) {
const DWORD lastError = GetLastError(); // QTBUG-35926, QTBUG-29716: may fail after lock screen.
if (lastError != ERROR_SUCCESS && lastError != ERROR_INVALID_HANDLE)
qErrnoWarning(lastError, "%s: BitBlt failed", __FUNCTION__);
}
rw->releaseDC();
#ifndef Q_OS_WINCE
}