summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowscontext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/windows/qwindowscontext.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index 545484de8d..3f4555a31f 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -271,22 +271,19 @@ QWindowsContextPrivate::QWindowsContextPrivate() :
m_eventType(QByteArrayLiteral("windows_generic_MSG")),
m_lastActiveWindow(0), m_asyncExpose(0)
{
+ const QSysInfo::WinVersion ver = QSysInfo::windowsVersion();
#ifndef Q_OS_WINCE
QWindowsContext::user32dll.init();
QWindowsContext::shell32dll.init();
-#endif
// Ensure metrics functions report correct data, QTBUG-30063.
if (QWindowsContext::user32dll.setProcessDPIAware)
QWindowsContext::user32dll.setProcessDPIAware();
- m_displayContext = GetDC(0);
- m_defaultDPI = GetDeviceCaps(m_displayContext, LOGPIXELSY);
- const QSysInfo::WinVersion ver = QSysInfo::windowsVersion();
-#ifndef Q_OS_WINCE
if (hasTouchSupport(ver) && QWindowsContext::user32dll.initTouch())
m_systemInfo |= QWindowsContext::SI_SupportsTouch;
-#endif
-
+#endif // !Q_OS_WINCE
+ m_displayContext = GetDC(0);
+ m_defaultDPI = GetDeviceCaps(m_displayContext, LOGPIXELSY);
if (useRTL_Extensions(ver)) {
m_systemInfo |= QWindowsContext::SI_RTL_Extensions;
m_keyMapper.setUseRTLExtensions(true);
@@ -417,10 +414,7 @@ QString QWindowsContext::registerWindowClass(const QWindow *w, bool isGL)
if (icon)
cname += QStringLiteral("Icon");
- HBRUSH brush = 0;
- if (!isGL)
- brush = GetSysColorBrush(COLOR_WINDOW);
- return registerWindowClass(cname, qWindowsWndProc, style, brush, icon);
+ return registerWindowClass(cname, qWindowsWndProc, style, GetSysColorBrush(COLOR_WINDOW), icon);
}
QString QWindowsContext::registerWindowClass(QString cname,