diff options
author | Andre de la Rocha <andre.rocha@qt.io> | 2018-05-25 14:48:03 +0200 |
---|---|---|
committer | Andre de la Rocha <andre.rocha@qt.io> | 2018-07-12 09:52:07 +0000 |
commit | 20d6dac63c25d227ed5315801e3e853ee78ec248 (patch) | |
tree | 1d192a1f407db1146191db653e3b1737d0d27d55 /src/plugins/platforms/windows/qwindowsintegration.cpp | |
parent | dffbf4a7f6b5d5544c13ac059822512a770d4df8 (diff) |
Add Windows Pointer Input Messages support
Replaces the handling of tablet/touchscreen/touchpad/mouse input with a
unified implementation based on the Windows Pointer Input Messages added
to Windows 8. The legacy implementation is still used for Windows 7.
Task-number: QTBUG-60437
Change-Id: I0a0f48ee9d5365f84ba528aa04c6ab1fe4253c50
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsintegration.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsintegration.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 9131b323df..7194fa1d1f 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -212,6 +212,8 @@ static inline unsigned parseOptions(const QStringList ¶mList, options |= QWindowsIntegration::AlwaysUseNativeMenus; } else if (param == QLatin1String("menus=none")) { options |= QWindowsIntegration::NoNativeMenus; + } else if (param == QLatin1String("nowmpointer")) { + options |= QWindowsIntegration::DontUseWMPointer; } else { qWarning() << "Unknown option" << param; } @@ -230,8 +232,13 @@ QWindowsIntegrationPrivate::QWindowsIntegrationPrivate(const QStringList ¶mL QtWindows::ProcessDpiAwareness dpiAwareness = QtWindows::ProcessPerMonitorDpiAware; m_options = parseOptions(paramList, &tabletAbsoluteRange, &dpiAwareness); QWindowsFontDatabase::setFontOptions(m_options); - if (tabletAbsoluteRange >= 0) - m_context.setTabletAbsoluteRange(tabletAbsoluteRange); + + if (!m_context.initPointer(m_options)) { + m_context.initTablet(m_options); + if (tabletAbsoluteRange >= 0) + m_context.setTabletAbsoluteRange(tabletAbsoluteRange); + } + if (!dpiAwarenessSet) { // Set only once in case of repeated instantiations of QGuiApplication. if (!QCoreApplication::testAttribute(Qt::AA_PluginApplication)) { m_context.setProcessDpiAwareness(dpiAwareness); |