diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-01-12 09:01:52 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-01-12 11:07:56 +0100 |
commit | 6b8c0a50585bb637c5cd33ca8ffde0cb9c4e3664 (patch) | |
tree | 12647726671357a571e2b371b0e33199efb08156 /src/plugins/platforms/windows | |
parent | 66d94ea30be9c4c8cc81a52134022eb662bedd77 (diff) | |
parent | ca7f1d2197f78ec3332cfd86ab9921730b6d4f23 (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: I5839bded07e23af65ced9491c4f50242f964dd31
Diffstat (limited to 'src/plugins/platforms/windows')
4 files changed, 22 insertions, 5 deletions
diff --git a/src/plugins/platforms/windows/openglblacklists/default.json b/src/plugins/platforms/windows/openglblacklists/default.json index 2672711d3a..767eac161c 100644 --- a/src/plugins/platforms/windows/openglblacklists/default.json +++ b/src/plugins/platforms/windows/openglblacklists/default.json @@ -1,6 +1,6 @@ { "name": "Qt built-in GPU driver blacklist", - "version": "5.5", + "version": "5.6", "entries": [ { "id": 1, diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 217444d129..c954e0a96d 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -405,14 +405,29 @@ void QWindowsContext::setTabletAbsoluteRange(int a) #endif } +int QWindowsContext::processDpiAwareness() +{ +#ifndef Q_OS_WINCE + int result; + if (QWindowsContext::shcoredll.getProcessDpiAwareness + && SUCCEEDED(QWindowsContext::shcoredll.getProcessDpiAwareness(NULL, &result))) { + return result; + } +#endif // !Q_OS_WINCE + return -1; +} + void QWindowsContext::setProcessDpiAwareness(QtWindows::ProcessDpiAwareness dpiAwareness) { #ifndef Q_OS_WINCE qCDebug(lcQpaWindows) << __FUNCTION__ << dpiAwareness; if (QWindowsContext::shcoredll.isValid()) { const HRESULT hr = QWindowsContext::shcoredll.setProcessDpiAwareness(dpiAwareness); - if (FAILED(hr)) - qWarning() << "SetProcessDpiAwareness failed:" << QWindowsContext::comErrorString(hr); + if (FAILED(hr)) { + qWarning().noquote().nospace() << "SetProcessDpiAwareness(" + << dpiAwareness << ") failed: " << QWindowsContext::comErrorString(hr) + << ", using " << QWindowsContext::processDpiAwareness(); + } } else { if (dpiAwareness != QtWindows::ProcessDpiUnaware && QWindowsContext::user32dll.setProcessDPIAware) { if (!QWindowsContext::user32dll.setProcessDPIAware()) diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h index d08fc8f726..14baec96d8 100644 --- a/src/plugins/platforms/windows/qwindowscontext.h +++ b/src/plugins/platforms/windows/qwindowscontext.h @@ -148,7 +148,7 @@ struct QWindowsShcoreDLL { void init(); inline bool isValid() const { return getProcessDpiAwareness && setProcessDpiAwareness && getDpiForMonitor; } - typedef HRESULT (WINAPI *GetProcessDpiAwareness)(HANDLE,int); + typedef HRESULT (WINAPI *GetProcessDpiAwareness)(HANDLE,int *); typedef HRESULT (WINAPI *SetProcessDpiAwareness)(int); typedef HRESULT (WINAPI *GetDpiForMonitor)(HMONITOR,int,UINT *,UINT *); @@ -219,6 +219,7 @@ public: void setTabletAbsoluteRange(int a); void setProcessDpiAwareness(QtWindows::ProcessDpiAwareness dpiAwareness); + static int processDpiAwareness(); // Returns a combination of SystemInfoFlags unsigned systemInfo() const; diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index f43265be67..b2781c8212 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -224,7 +224,8 @@ QWindowsIntegrationPrivate::QWindowsIntegrationPrivate(const QStringList ¶mL if (!QCoreApplication::testAttribute(Qt::AA_PluginApplication)) { m_context.setProcessDpiAwareness(dpiAwareness); qCDebug(lcQpaWindows) - << __FUNCTION__ << "DpiAwareness=" << dpiAwareness; + << __FUNCTION__ << "DpiAwareness=" << dpiAwareness + << "effective process DPI awareness=" << QWindowsContext::processDpiAwareness(); } dpiAwarenessSet = true; } |