diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-07-22 06:29:20 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-07-22 17:46:09 +0000 |
commit | ac98b6e4ea46835d01b4c8f35b566a92136c90fe (patch) | |
tree | 18230c81ef0139f9c3fed87f886566ec7fc5d628 /src/plugins/platforms/windows/qwindowswindow.h | |
parent | 034427a45a0f220d6a7e38bac4c70cfd60b07982 (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/qwindowswindow.h')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index 8d47b5b4f3..27c225f626 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -42,6 +42,7 @@ #include <QtCore/qt_windows.h> #include <QtCore/qpointer.h> +#include "qwindowsapplication.h" #include "qwindowscursor.h" #include <qpa/qplatformwindow.h> @@ -51,6 +52,8 @@ #include "qwindowsvulkaninstance.h" #endif +#include <optional> + QT_BEGIN_NAMESPACE class QWindowsOleDropTarget; @@ -125,6 +128,9 @@ class QWindowsBaseWindow : public QPlatformWindow { Q_DISABLE_COPY_MOVE(QWindowsBaseWindow) public: + using TouchWindowTouchType = QPlatformInterface::Private::QWindowsApplication::TouchWindowTouchType; + using TouchWindowTouchTypes = QPlatformInterface::Private::QWindowsApplication::TouchWindowTouchTypes; + explicit QWindowsBaseWindow(QWindow *window) : QPlatformWindow(window) {} WId winId() const override { return WId(handle()); } @@ -153,6 +159,7 @@ protected: QRect geometry_sys() const; void setGeometry_sys(const QRect &rect) const; QMargins frameMargins_sys() const; + std::optional<TouchWindowTouchTypes> touchWindowTouchTypes_sys() const; void hide_sys(); void raise_sys(); void lower_sys(); @@ -348,8 +355,7 @@ public: enum ScreenChangeMode { FromGeometryChange, FromDpiChange }; void checkForScreenChanged(ScreenChangeMode mode = FromGeometryChange); - static void setTouchWindowTouchTypeStatic(QWindow *window, QWindowsWindowFunctions::TouchWindowTouchTypes touchTypes); - void registerTouchWindow(QWindowsWindowFunctions::TouchWindowTouchTypes touchTypes = QWindowsWindowFunctions::NormalTouch); + void registerTouchWindow(); static void setHasBorderInFullScreenStatic(QWindow *window, bool border); static void setHasBorderInFullScreenDefault(bool border); void setHasBorderInFullScreen(bool border); |