summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-07-13 16:34:32 -0700
committerGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-07-13 16:36:10 -0700
commitd38fe875c7850ca2c6ca28f91e94ae276735fac8 (patch)
treee5c92cef74e0853490d77cf0139b23f00d548a6e /src/plugins/platforms/windows
parentac4e848c9802377b7c4ff673180f28b9ca76b746 (diff)
parent627f0a7f7d775ecd263b95dd07fca44bfcb0c5cf (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/widgets/widgets/qmainwindowlayout.cpp Change-Id: I306b4f5ad11bceb336c9091241b468d455fe6bb6
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r--src/plugins/platforms/windows/openglblacklists/default.json12
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp26
-rw-r--r--src/plugins/platforms/windows/qwindowsscreen.cpp10
-rw-r--r--src/plugins/platforms/windows/qwindowstheme.cpp18
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp6
5 files changed, 61 insertions, 11 deletions
diff --git a/src/plugins/platforms/windows/openglblacklists/default.json b/src/plugins/platforms/windows/openglblacklists/default.json
index 69f4a54d05..6515f02830 100644
--- a/src/plugins/platforms/windows/openglblacklists/default.json
+++ b/src/plugins/platforms/windows/openglblacklists/default.json
@@ -126,6 +126,18 @@
"features": [
"disable_desktopgl"
]
+ },
+ {
+ "id": 11,
+ "description": "VMWare Workstation Player 12 has insufficient support for OpenGL",
+ "vendor_id": "0x15AD",
+ "device_id": [ "0x0405" ],
+ "os": {
+ "type": "win"
+ },
+ "features": [
+ "disable_desktopgl", "disable_d3d11"
+ ]
}
]
}
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index 49c11ba2b7..36481b8ed7 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -844,6 +844,27 @@ static inline QWindowsInputContext *windowsInputContext()
return qobject_cast<QWindowsInputContext *>(QWindowsIntegration::instance()->inputContext());
}
+
+// Child windows, fixed-size windows or pop-ups and similar should not be resized
+static inline bool resizeOnDpiChanged(const QWindow *w)
+{
+ bool result = false;
+ if (w->isTopLevel()) {
+ switch (w->type()) {
+ case Qt::Window:
+ case Qt::Dialog:
+ case Qt::Sheet:
+ case Qt::Drawer:
+ case Qt::Tool:
+ result = !w->flags().testFlag(Qt::MSWindowsFixedSizeDialogHint);
+ break;
+ default:
+ break;
+ }
+ }
+ return result;
+}
+
/*!
\brief Main windows procedure registered for windows.
@@ -1118,9 +1139,8 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
#endif
} break;
case QtWindows::DpiChangedEvent: {
- if (platformWindow->window()->flags().testFlag(Qt::MSWindowsFixedSizeDialogHint))
- return false; // Fixed-size window should not be resized
-
+ if (!resizeOnDpiChanged(platformWindow->window()))
+ return false;
platformWindow->setFlag(QWindowsWindow::WithinDpiChanged);
const RECT *prcNewWindow = reinterpret_cast<RECT *>(lParam);
SetWindowPos(hwnd, NULL, prcNewWindow->left, prcNewWindow->top,
diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp
index 24fb12d27a..3a4793efcd 100644
--- a/src/plugins/platforms/windows/qwindowsscreen.cpp
+++ b/src/plugins/platforms/windows/qwindowsscreen.cpp
@@ -153,7 +153,8 @@ static QDebug operator<<(QDebug dbg, const QWindowsScreenData &d)
<< d.availableGeometry.width() << 'x' << d.availableGeometry.height() << '+' << d.availableGeometry.x() << '+' << d.availableGeometry.y()
<< " physical: " << d.physicalSizeMM.width() << 'x' << d.physicalSizeMM.height()
<< " DPI: " << d.dpi.first << 'x' << d.dpi.second << " Depth: " << d.depth
- << " Format: " << d.format;
+ << " Format: " << d.format
+ << " hMonitor: " << d.hMonitor;
if (d.flags & QWindowsScreenData::PrimaryScreen)
dbg << " primary";
if (d.flags & QWindowsScreenData::VirtualDesktop)
@@ -290,6 +291,13 @@ void QWindowsScreen::handleChanges(const QWindowsScreenData &newData)
{
m_data.physicalSizeMM = newData.physicalSizeMM;
+ if (m_data.hMonitor != newData.hMonitor) {
+ qCDebug(lcQpaWindows) << "Monitor" << m_data.name
+ << "has had its hMonitor handle changed from"
+ << m_data.hMonitor << "to" << newData.hMonitor;
+ m_data.hMonitor = newData.hMonitor;
+ }
+
if (m_data.geometry != newData.geometry || m_data.availableGeometry != newData.availableGeometry) {
m_data.geometry = newData.geometry;
m_data.availableGeometry = newData.availableGeometry;
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp
index 3165835d2d..a1ccf1f83c 100644
--- a/src/plugins/platforms/windows/qwindowstheme.cpp
+++ b/src/plugins/platforms/windows/qwindowstheme.cpp
@@ -869,12 +869,18 @@ QPixmap QWindowsFileIconEngine::filePixmap(const QSize &size, QIcon::Mode, QIcon
}
SHFILEINFO info;
- const unsigned int flags =
- SHGFI_ICON|iconSize|SHGFI_SYSICONINDEX|SHGFI_ADDOVERLAYS|SHGFI_OVERLAYINDEX;
-
- const bool val = cacheableDirIcon && useDefaultFolderIcon
- ? shGetFileInfoBackground(QString::fromWCharArray(L"dummy"), FILE_ATTRIBUTE_DIRECTORY, &info, flags | SHGFI_USEFILEATTRIBUTES)
- : shGetFileInfoBackground(filePath, 0, &info, flags);
+ unsigned int flags = SHGFI_ICON | iconSize | SHGFI_SYSICONINDEX | SHGFI_ADDOVERLAYS | SHGFI_OVERLAYINDEX;
+ DWORD attributes = 0;
+ QString path = filePath;
+ if (cacheableDirIcon && useDefaultFolderIcon) {
+ flags |= SHGFI_USEFILEATTRIBUTES;
+ attributes |= FILE_ATTRIBUTE_DIRECTORY;
+ path = QStringLiteral("dummy");
+ } else if (!fileInfo().exists()) {
+ flags |= SHGFI_USEFILEATTRIBUTES;
+ attributes |= FILE_ATTRIBUTE_NORMAL;
+ }
+ const bool val = shGetFileInfoBackground(path, attributes, &info, flags);
// Even if GetFileInfo returns a valid result, hIcon can be empty in some cases
if (val && info.hIcon) {
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 25d50e6466..9c8a3d4956 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -39,7 +39,9 @@
#include "qwindowswindow.h"
#include "qwindowscontext.h"
-#include "qwindowsdrag.h"
+#if QT_CONFIG(draganddrop)
+# include "qwindowsdrag.h"
+#endif
#include "qwindowsscreen.h"
#include "qwindowsintegration.h"
#include "qwindowsmenu.h"
@@ -1834,6 +1836,8 @@ bool QWindowsWindow::isFullScreen_sys() const
if (!w->isTopLevel())
return false;
QRect geometry = geometry_sys();
+ if (testFlag(HasBorderInFullScreen))
+ geometry += QMargins(1, 1, 1, 1);
QPlatformScreen *screen = screenForGeometry(geometry);
return screen && geometry == QHighDpi::toNativePixels(screen->geometry(), screen);
}