diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2016-11-01 10:42:21 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2016-11-01 13:26:35 +0000 |
commit | c4ad427523313c2ad9d773501fdc43bffe240f08 (patch) | |
tree | 3afff05df714be01591ce07478743a282a57281f | |
parent | 3443483c9efdcfbfe049f96c83f83a5bf1d81e61 (diff) |
Compositor: Switch keyboard focus on touch input
When touchEventsEnabled is set to true on ShellSurfaceItem, touching a
client did not switch the keyboard focus to that client. Consequently,
touching inside a TextField would not switch the focus to that client,
causing keyboard and virtual keyboard input to be delivered to the wrong
client.
Task-number: QTBUG-56836
Change-Id: I47134dfeb80d25e995baf91e51977dacb7087bb7
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
-rw-r--r-- | src/compositor/compositor_api/qwaylandquickitem.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index f0454b72c..e6cfce343 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -653,6 +653,9 @@ void QWaylandQuickItem::touchEvent(QTouchEvent *event) seat->sendMouseMoveEvent(d->view.data(), pointPos, mapToScene(pointPos)); } seat->sendFullTouchEvent(surface(), event); + + if (event->type() == QEvent::TouchBegin && d->focusOnClick) + takeFocus(seat); } else { event->ignore(); } @@ -921,7 +924,7 @@ void QWaylandQuickItem::updateSize() * \qmlproperty bool QtWaylandCompositor::WaylandQuickItem::focusOnClick * * This property specifies whether the WaylandQuickItem should take focus when - * it is clicked. + * it is clicked or touched. * * The default is \c true. */ @@ -930,7 +933,7 @@ void QWaylandQuickItem::updateSize() * \property QWaylandQuickItem::focusOnClick * * This property specifies whether the QWaylandQuickItem should take focus when - * it is clicked. + * it is clicked or touched. * * The default is \c true. */ |