summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qshapedpixmapdndwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qshapedpixmapdndwindow.cpp')
-rw-r--r--src/gui/kernel/qshapedpixmapdndwindow.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/kernel/qshapedpixmapdndwindow.cpp b/src/gui/kernel/qshapedpixmapdndwindow.cpp
index b54c6b67a2..8509eb0961 100644
--- a/src/gui/kernel/qshapedpixmapdndwindow.cpp
+++ b/src/gui/kernel/qshapedpixmapdndwindow.cpp
@@ -39,6 +39,8 @@
#include "qshapedpixmapdndwindow_p.h"
+#include "qplatformwindow.h"
+
#include <QtGui/QPainter>
#include <QtGui/QCursor>
#include <QtGui/QGuiApplication>
@@ -70,7 +72,12 @@ void QShapedPixmapWindow::setPixmap(const QPixmap &pixmap)
if (!mask.isNull()) {
if (!handle())
create();
- setMask(mask);
+ if (auto platformWindow = handle()) {
+ const auto pixmapDpr = m_pixmap.devicePixelRatio();
+ const auto winDpr = devicePixelRatio();
+ const auto maskSize = (QSizeF(m_pixmap.size()) * winDpr / pixmapDpr).toSize();
+ platformWindow->setMask(QBitmap(mask.scaled(maskSize)));
+ }
}
}
}