diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2017-02-14 15:09:46 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2017-02-20 13:15:06 +0000 |
commit | ca27d9021f60175932626e7511cc1e7f0545f6e6 (patch) | |
tree | 79703559f70e5378bebf9053fbfa62494599282b | |
parent | 262efbc390e58dab4c898a34bb566ea83288601c (diff) |
Don't try to send touch cancel events to null surfaces
Previously, when closing a surface by touch, the touch ungrab event
would cause a null dereference.
Change-Id: Icbb11c8bc096fef1e5cfd563d3657a39a14a5b5b
Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
-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 ee9fa5427..a39eff9e8 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -678,8 +678,11 @@ void QWaylandQuickItem::touchEvent(QTouchEvent *event) void QWaylandQuickItem::touchUngrabEvent() { Q_D(QWaylandQuickItem); - for (auto seat : d->touchingSeats) - seat->sendTouchCancelEvent(surface()->client()); + + if (d->shouldSendInputEvents()) + for (auto seat : d->touchingSeats) + seat->sendTouchCancelEvent(surface()->client()); + d->touchingSeats.clear(); } |