summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowscontext.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-07-22 06:29:20 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-07-22 17:46:09 +0000
commitac98b6e4ea46835d01b4c8f35b566a92136c90fe (patch)
tree18230c81ef0139f9c3fed87f886566ec7fc5d628 /src/plugins/platforms/windows/qwindowscontext.cpp
parent034427a45a0f220d6a7e38bac4c70cfd60b07982 (diff)
Windows QPA: Move the touch types API from platformheaders into QtGui
Change TouchWindowTouchType(s) to be (global) property of QGuiApplication's native Windows interface since it does not make sense to set it per window. It appears the previous code setting the types per Window has never worked since registerTouchWindow() bailed out due to the checks for the flags TouchRegistered and IsTouchWindow() (setting in HCBT_CREATEWND). In addition, registering windows for touch after plugging in a device would not observe the setting. Move the checks around to make this work. Task-number: QTBUG-41433 Task-number: QTBUG-48849 Task-number: QTBUG-83252 Change-Id: I4306fdf13208f6eef22655875f3bd1769270e617 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowscontext.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index b1658d4d8e..39278f31e8 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -366,12 +366,18 @@ bool QWindowsContext::initTouch(unsigned integrationOptions)
d->m_systemInfo |= QWindowsContext::SI_SupportsTouch;
// A touch device was plugged while the app is running. Register all windows for touch.
- if (QGuiApplicationPrivate::is_app_running) {
+ registerTouchWindows();
+
+ return true;
+}
+
+void QWindowsContext::registerTouchWindows()
+{
+ if (QGuiApplicationPrivate::is_app_running
+ && (d->m_systemInfo & QWindowsContext::SI_SupportsTouch) != 0) {
for (QWindowsWindow *w : qAsConst(d->m_windows))
w->registerTouchWindow();
}
-
- return true;
}
bool QWindowsContext::initTablet()