diff options
author | Andy Shaw <andy.shaw@digia.com> | 2015-02-18 15:19:10 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@digia.com> | 2015-03-11 07:15:53 +0000 |
commit | c87f8a379706e2a8099c42c2ffe09f258315bb64 (patch) | |
tree | 76e4216f5606c4b04ce9d41338b61a1ed7a28286 /src/plugins/platforms/windows/qwindowswindow.cpp | |
parent | 3b30a8215e98f6164a1650ce7c7e2a42a3d8746f (diff) |
Windows: Only set the touch flags if the window is not already registered
It is possible for there to be a HCBT_CREATEWND hook which can set the
touch window flags already while the window is being created. Therefore
we want to defer to those settings instead as they should take precedence.
Change-Id: If8dcbd34db2b3bbbfb1bc36731665fb17fb87c24
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 4cf8fcf4da..6b490b9404 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -2294,6 +2294,12 @@ void QWindowsWindow::registerTouchWindow(QWindowsWindowFunctions::TouchWindowTou #ifndef Q_OS_WINCE if ((QWindowsContext::instance()->systemInfo() & QWindowsContext::SI_SupportsTouch) && window()->type() != Qt::ForeignWindow) { + ULONG touchFlags = 0; + const bool ret = QWindowsContext::user32dll.isTouchWindow(m_data.hwnd, &touchFlags); + // Return if it is not a touch window or the flags are already set by a hook + // such as HCBT_CREATEWND + if (!ret || touchFlags != 0) + return; if (QWindowsContext::user32dll.registerTouchWindow(m_data.hwnd, (ULONG)touchTypes)) setFlag(TouchRegistered); else |