From fd6821740fece8650cac7494a2cffe63e2bebb9c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 29 Jun 2015 10:25:24 +0200 Subject: Highdpi changes for Windows Adapt the Windows plugin to work with the new cross-platform high-DPI scaling. Task-number: QTBUG-38993 Task-number: QTBUG-46615 Change-Id: I108d319255925a290b75611e95ef006d4aaf7ace Reviewed-by: Lars Knoll --- src/plugins/platforms/windows/qwindowsbackingstore.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowsbackingstore.cpp') diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.cpp b/src/plugins/platforms/windows/qwindowsbackingstore.cpp index fe56d3dddc..3f19e4401a 100644 --- a/src/plugins/platforms/windows/qwindowsbackingstore.cpp +++ b/src/plugins/platforms/windows/qwindowsbackingstore.cpp @@ -38,6 +38,7 @@ #include #include +#include #include @@ -82,8 +83,8 @@ void QWindowsBackingStore::flush(QWindow *window, const QRegion ®ion, const Qt::WindowFlags flags = window->flags(); if ((flags & Qt::FramelessWindowHint) && QWindowsWindow::setWindowLayered(rw->handle(), flags, hasAlpha, rw->opacity()) && hasAlpha) { // Windows with alpha: Use blend function to update. - QRect r = window->frameGeometry(); - QPoint frameOffset(window->frameMargins().left(), window->frameMargins().top()); + QRect r = QHighDpi::toNativePixels(window->frameGeometry(), window); + QPoint frameOffset(QHighDpi::toNativePixels(QPoint(window->frameMargins().left(), window->frameMargins().top()), window)); QRect dirtyRect = br.translated(offset + frameOffset); SIZE size = {r.width(), r.height()}; -- cgit v1.2.3