Skip to content

Commit

Permalink
QWindowSystemInterface: Add tablet event overloads without timestamps
Browse files Browse the repository at this point in the history
On some platforms, tablet events do not have a time stamp.

Task-number: QTBUG-46412
Change-Id: I3cc820b1edaaf55511c000fefb805f5a3a7872a6
Reviewed-by: Shawn Rutledge <[email protected]>
  • Loading branch information
FriedemannKleint committed Oct 17, 2020
1 parent 4a72805 commit 9ed75b6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/gui/kernel/qwindowsysteminterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,18 @@ bool QWindowSystemInterface::handleTabletEvent(QWindow *window, ulong timestamp,
return QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}

bool QWindowSystemInterface::handleTabletEvent(QWindow *window, const QPointingDevice *device,
const QPointF &local, const QPointF &global,
Qt::MouseButtons buttons, qreal pressure, int xTilt, int yTilt,
qreal tangentialPressure, qreal rotation, int z,
Qt::KeyboardModifiers modifiers)
{
const ulong time = QWindowSystemInterfacePrivate::eventTime.elapsed();
return handleTabletEvent(window, time, device, local, global,
buttons, pressure, xTilt, yTilt, tangentialPressure,
rotation, z, modifiers);
}

bool QWindowSystemInterface::handleTabletEvent(QWindow *window, ulong timestamp, const QPointF &local, const QPointF &global,
int device, int pointerType, Qt::MouseButtons buttons, qreal pressure, int xTilt, int yTilt,
qreal tangentialPressure, qreal rotation, int z, qint64 uid,
Expand Down Expand Up @@ -969,6 +981,19 @@ bool QWindowSystemInterface::handleTabletEnterLeaveProximityEvent(QWindow *windo
}
}

bool QWindowSystemInterface::handleTabletEnterLeaveProximityEvent(QWindow *window, const QPointingDevice *device,
bool inProximity, const QPointF &local, const QPointF &global,
Qt::MouseButtons buttons, int xTilt, int yTilt,
qreal tangentialPressure, qreal rotation, int z,
Qt::KeyboardModifiers modifiers)
{
const ulong time = QWindowSystemInterfacePrivate::eventTime.elapsed();
return handleTabletEnterLeaveProximityEvent(window, time, device, inProximity,
local, global, buttons, xTilt, yTilt,
tangentialPressure, rotation, z, modifiers);
}


bool QWindowSystemInterface::handleTabletEnterProximityEvent(ulong timestamp, int deviceType, int pointerType, qint64 uid)
{
const QPointingDevice *device = QPointingDevicePrivate::tabletDevice(QInputDevice::DeviceType(deviceType),
Expand Down
9 changes: 9 additions & 0 deletions src/gui/kernel/qwindowsysteminterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ class Q_GUI_EXPORT QWindowSystemInterface
const QPointF &local, const QPointF &global,
Qt::MouseButtons buttons, qreal pressure, int xTilt, int yTilt,
qreal tangentialPressure, qreal rotation, int z, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
static bool handleTabletEvent(QWindow *window, const QPointingDevice *device,
const QPointF &local, const QPointF &global,
Qt::MouseButtons buttons, qreal pressure, int xTilt, int yTilt,
qreal tangentialPressure, qreal rotation, int z, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
static bool handleTabletEvent(QWindow *window, ulong timestamp, const QPointF &local, const QPointF &global,
int device, int pointerType, Qt::MouseButtons buttons, qreal pressure, int xTilt, int yTilt,
qreal tangentialPressure, qreal rotation, int z, qint64 uid,
Expand All @@ -270,6 +274,11 @@ class Q_GUI_EXPORT QWindowSystemInterface
Qt::MouseButtons buttons = {}, int xTilt = 0, int yTilt = 0,
qreal tangentialPressure = 0, qreal rotation = 0, int z = 0,
Qt::KeyboardModifiers modifiers = Qt::NoModifier);
static bool handleTabletEnterLeaveProximityEvent(QWindow *window, const QPointingDevice *device,
bool inProximity, const QPointF &local = QPointF(), const QPointF &global = QPointF(),
Qt::MouseButtons buttons = {}, int xTilt = 0, int yTilt = 0,
qreal tangentialPressure = 0, qreal rotation = 0, int z = 0,
Qt::KeyboardModifiers modifiers = Qt::NoModifier);
static bool handleTabletEnterProximityEvent(ulong timestamp, int deviceType, int pointerType, qint64 uid);
static void handleTabletEnterProximityEvent(int deviceType, int pointerType, qint64 uid);
static bool handleTabletLeaveProximityEvent(ulong timestamp, int deviceType, int pointerType, qint64 uid);
Expand Down

0 comments on commit 9ed75b6

Please sign in to comment.