From ac98b6e4ea46835d01b4c8f35b566a92136c90fe Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 22 Jul 2020 06:29:20 +0200 Subject: Windows QPA: Move the touch types API from platformheaders into QtGui MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- .../windowsfunctions/qwindowswindowfunctions.qdoc | 30 ---------------------- .../windowsfunctions/qwindowswindowfunctions_p.h | 20 --------------- 2 files changed, 50 deletions(-) (limited to 'src/platformheaders') diff --git a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc index b848df2d09..f211165936 100644 --- a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc +++ b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc @@ -41,36 +41,6 @@ version it was developed against. */ -/*! - \enum QWindowsWindowFunctions::TouchWindowTouchType - - This enum represents the supported TouchWindow touch flags for RegisterTouchWindow(). - - \value NormalTouch - \value FineTouch - \value WantPalmTouch -*/ - -/*! - \typedef QWindowsWindowFunctions::SetTouchWindowTouchType - - This is the typedef for the function returned by QGuiApplication::platformFunction when passed setTouchWindowTouchTypeIdentifier. -*/ - -/*! - \fn QByteArray QWindowsWindowFunctions::setTouchWindowTouchTypeIdentifier() - - This function returns the bytearray that can be used to query - QGuiApplication::platformFunction to retrieve the SetTouchWindowTouchType function. -*/ - -/*! - \fn void QWindowsWindowFunctions::setTouchWindowTouchType(QWindow *window, TouchWindowTouchTypes type) - - This is a convenience function that can be used directly instead of resolving the function pointer. - \a window and \a type will be relayed to the function retrieved by QGuiApplication -*/ - /*! \typedef QWindowsWindowFunctions::SetHasBorderInFullScreen diff --git a/src/platformheaders/windowsfunctions/qwindowswindowfunctions_p.h b/src/platformheaders/windowsfunctions/qwindowswindowfunctions_p.h index 6b06b40084..780be22a05 100644 --- a/src/platformheaders/windowsfunctions/qwindowswindowfunctions_p.h +++ b/src/platformheaders/windowsfunctions/qwindowswindowfunctions_p.h @@ -60,24 +60,6 @@ class QWindow; class QWindowsWindowFunctions { public: - enum TouchWindowTouchType { - NormalTouch = 0x00000000, - FineTouch = 0x00000001, - WantPalmTouch = 0x00000002 - }; - - Q_DECLARE_FLAGS(TouchWindowTouchTypes, TouchWindowTouchType) - - typedef void (*SetTouchWindowTouchType)(QWindow *window, QWindowsWindowFunctions::TouchWindowTouchTypes touchType); - static const QByteArray setTouchWindowTouchTypeIdentifier() { return QByteArrayLiteral("WindowsSetTouchWindowTouchType"); } - - static void setTouchWindowTouchType(QWindow *window, TouchWindowTouchTypes type) - { - SetTouchWindowTouchType func = reinterpret_cast(QGuiApplication::platformFunction(setTouchWindowTouchTypeIdentifier())); - if (func) - func(window, type); - } - typedef void (*SetHasBorderInFullScreen)(QWindow *window, bool border); static const QByteArray setHasBorderInFullScreenIdentifier() { return QByteArrayLiteral("WindowsSetHasBorderInFullScreen"); } static void setHasBorderInFullScreen(QWindow *window, bool border) @@ -98,8 +80,6 @@ public: }; -Q_DECLARE_OPERATORS_FOR_FLAGS(QWindowsWindowFunctions::TouchWindowTouchTypes) - QT_END_NAMESPACE #endif // QWINDOWSWINDOWFUNCTIONS_H -- cgit v1.2.3