Windows: Fix frame margins calculation
Passing nullptr to QHighDpi::toNativePixels() is seldom correct, and will work only on the main screen. Instead, call frameMargins() on the platform window (instead of on the QWindow) and get the margins directly in native pixels. Pick-to: 5.15 Fixes: QTBUG-90716 Change-Id: Id7b31ec3246010c367781b64ed832c589bbaeb0d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
parent
7d1cda9de3
commit
dafe9e2363
@ -91,9 +91,8 @@ void QWindowsBackingStore::flush(QWindow *window, const QRegion ®ion,
|
||||
if ((flags & Qt::FramelessWindowHint) && QWindowsWindow::setWindowLayered(rw->handle(), flags, hasAlpha, rw->opacity()) && hasAlpha) {
|
||||
// Windows with alpha: Use blend function to update.
|
||||
QRect r = QHighDpi::toNativePixels(window->frameGeometry(), window);
|
||||
QPoint frameOffset(QHighDpi::toNativePixels(QPoint(window->frameMargins().left(), window->frameMargins().top()),
|
||||
static_cast<const QWindow *>(nullptr)));
|
||||
QRect dirtyRect = br.translated(offset + frameOffset);
|
||||
QMargins frameMargins = rw->frameMargins();
|
||||
QRect dirtyRect = br.translated(offset + QPoint(frameMargins.left(), frameMargins.top()));
|
||||
|
||||
SIZE size = {r.width(), r.height()};
|
||||
POINT ptDst = {r.x(), r.y()};
|
||||
|
Loading…
x
Reference in New Issue
Block a user