Client: Pass tablet input to decorations
Otherwise decoration cannot be interacted with using a stylus. Since there is no reason for the decoration to distinguish between stylus and mouse input reuse the existing mouse handling instead of adding a dedicated tablet input function to the decoration API. Fixes: QTBUG-117920 Pick-to: 6.8 Change-Id: I947e5b4f638fb3c2b15a1ca4ed01c02caf9d4812 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
parent
bb15139024
commit
fcdef0cd5f
@ -382,10 +382,19 @@ void QWaylandTabletToolV2::zwp_tablet_tool_v2_frame(uint32_t time)
|
|||||||
qreal rotation = m_pending.rotation;
|
qreal rotation = m_pending.rotation;
|
||||||
int z = int(m_pending.distance);
|
int z = int(m_pending.distance);
|
||||||
|
|
||||||
QWindowSystemInterface::handleTabletEvent(window, timestamp, this, localPosition, globalPosition,
|
// do not use localPosition here since that is in Qt window coordinates
|
||||||
buttons, pressure,
|
// but we need surface coordinates to include the decoration
|
||||||
xTilt, yTilt, tangentialPressure, rotation, z,
|
bool decorationHandledEvent = waylandWindow->handleTabletEventDecoration(
|
||||||
m_tabletSeat->seat()->modifiers());
|
m_tabletSeat->seat(), m_pending.surfacePosition,
|
||||||
|
window->mapToGlobal(m_pending.surfacePosition) + delta, buttons,
|
||||||
|
m_tabletSeat->seat()->modifiers());
|
||||||
|
|
||||||
|
if (!decorationHandledEvent) {
|
||||||
|
QWindowSystemInterface::handleTabletEvent(window, timestamp, this, localPosition, globalPosition,
|
||||||
|
buttons, pressure,
|
||||||
|
xTilt, yTilt, tangentialPressure, rotation, z,
|
||||||
|
m_tabletSeat->seat()->modifiers());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_applied = m_pending;
|
m_applied = m_pending;
|
||||||
|
@ -1360,6 +1360,16 @@ bool QWaylandWindow::touchDragDecoration(QWaylandInputDevice *inputDevice, const
|
|||||||
return mWindowDecoration->handleTouch(inputDevice, local, global, state, mods);
|
return mWindowDecoration->handleTouch(inputDevice, local, global, state, mods);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QWaylandWindow::handleTabletEventDecoration(QWaylandInputDevice *inputDevice,
|
||||||
|
const QPointF &local, const QPointF &global,
|
||||||
|
Qt::MouseButtons buttons,
|
||||||
|
Qt::KeyboardModifiers modifiers)
|
||||||
|
{
|
||||||
|
if (!mWindowDecorationEnabled)
|
||||||
|
return false;
|
||||||
|
return mWindowDecoration->handleMouse(inputDevice, local, global, buttons, modifiers);
|
||||||
|
}
|
||||||
|
|
||||||
void QWaylandWindow::handleMouseEventWithDecoration(QWaylandInputDevice *inputDevice, const QWaylandPointerEvent &e)
|
void QWaylandWindow::handleMouseEventWithDecoration(QWaylandInputDevice *inputDevice, const QWaylandPointerEvent &e)
|
||||||
{
|
{
|
||||||
if (mMousePressedInContentArea == Qt::NoButton &&
|
if (mMousePressedInContentArea == Qt::NoButton &&
|
||||||
|
@ -180,6 +180,9 @@ public:
|
|||||||
|
|
||||||
bool touchDragDecoration(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global,
|
bool touchDragDecoration(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global,
|
||||||
QEventPoint::State state, Qt::KeyboardModifiers mods);
|
QEventPoint::State state, Qt::KeyboardModifiers mods);
|
||||||
|
bool handleTabletEventDecoration(QWaylandInputDevice *inputDevice, const QPointF &local,
|
||||||
|
const QPointF &global, Qt::MouseButtons buttons,
|
||||||
|
Qt::KeyboardModifiers modifiers);
|
||||||
|
|
||||||
bool createDecoration();
|
bool createDecoration();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user