summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-04-11 08:48:27 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2016-04-11 09:12:36 +0200
commitf34e73a16a3d757057e007874cb5008f16e20f02 (patch)
treebcc228617cf240773fd09daac1a1a2614b552b68 /src/plugins/platforms/windows
parent5380808453728a354ae28aae76e85ac448245cf1 (diff)
parentb9d386f2ccd69c7f6a766a6d90a6024eeb48e90a (diff)
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts: src/corelib/kernel/qobject.cpp src/gui/painting/qpaintengine_raster.cpp Change-Id: I74e1779832f43d033708dcfd6b666c7b4f0111fb
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r--src/plugins/platforms/windows/qwindowscursor.cpp10
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp8
-rw-r--r--src/plugins/platforms/windows/qwindowsnativeinterface.cpp6
3 files changed, 15 insertions, 9 deletions
diff --git a/src/plugins/platforms/windows/qwindowscursor.cpp b/src/plugins/platforms/windows/qwindowscursor.cpp
index d952fde978..1bebe88df7 100644
--- a/src/plugins/platforms/windows/qwindowscursor.cpp
+++ b/src/plugins/platforms/windows/qwindowscursor.cpp
@@ -103,9 +103,9 @@ QWindowsPixmapCursorCacheKey::QWindowsPixmapCursorCacheKey(const QCursor &c)
HCURSOR QWindowsCursor::createPixmapCursor(QPixmap pixmap, const QPoint &hotSpot, qreal scaleFactor)
{
HCURSOR cur = 0;
- scaleFactor /= pixmap.devicePixelRatioF();
- if (!qFuzzyCompare(scaleFactor, 1)) {
- pixmap = pixmap.scaled((scaleFactor * QSizeF(pixmap.size())).toSize(),
+ const qreal pixmapScaleFactor = scaleFactor / pixmap.devicePixelRatioF();
+ if (!qFuzzyCompare(pixmapScaleFactor, 1)) {
+ pixmap = pixmap.scaled((pixmapScaleFactor * QSizeF(pixmap.size())).toSize(),
Qt::KeepAspectRatio, Qt::SmoothTransformation);
}
QBitmap mask = pixmap.mask();
@@ -119,8 +119,8 @@ HCURSOR QWindowsCursor::createPixmapCursor(QPixmap pixmap, const QPoint &hotSpot
ICONINFO ii;
ii.fIcon = 0;
- ii.xHotspot = DWORD(hotSpot.x());
- ii.yHotspot = DWORD(hotSpot.y());
+ ii.xHotspot = DWORD(qRound(hotSpot.x() * scaleFactor));
+ ii.yHotspot = DWORD(qRound(hotSpot.y() * scaleFactor));
ii.hbmMask = im;
ii.hbmColor = ic;
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index 941b014588..b2fde7a0c6 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -344,10 +344,14 @@ QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) cons
if (requested.flags != obtained.flags)
window->setFlags(obtained.flags);
- // Trigger geometry/screen change signals of QWindow.
+ // Trigger geometry change (unless it has a special state in which case setWindowState()
+ // will send the message) and screen change signals of QWindow.
if ((obtained.flags & Qt::Desktop) != Qt::Desktop) {
- if (requested.geometry != obtained.geometry)
+ const Qt::WindowState state = window->windowState();
+ if (state != Qt::WindowMaximized && state != Qt::WindowFullScreen
+ && requested.geometry != obtained.geometry) {
QWindowSystemInterface::handleGeometryChange(window, obtained.geometry);
+ }
QPlatformScreen *screen = result->screenForGeometry(obtained.geometry);
if (screen && result->screen() != screen)
QWindowSystemInterface::handleWindowScreenChanged(window, screen->screen());
diff --git a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp
index babca35149..e0ae111b9a 100644
--- a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp
+++ b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp
@@ -163,8 +163,10 @@ void *QWindowsNativeInterface::nativeResourceForIntegration(const QByteArray &re
#ifdef QT_NO_OPENGL
Q_UNUSED(resource)
#else
- if (resourceType(resource) == GlHandleType)
- return QWindowsIntegration::staticOpenGLContext()->moduleHandle();
+ if (resourceType(resource) == GlHandleType) {
+ if (const QWindowsStaticOpenGLContext *sc = QWindowsIntegration::staticOpenGLContext())
+ return sc->moduleHandle();
+ }
#endif
return 0;