summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElvis Lee <kwangwoong.lee@lge.com>2016-01-29 11:31:06 +0900
committerPaul Olav Tvete <paul.tvete@theqtcompany.com>2016-02-25 14:22:41 +0000
commit0a62a4623dbce0d3ebda99c6af1a4fd4f6f408e5 (patch)
tree9809d16f6c9dc46f5202db32277cabd510c18839
parentbebe9beff3e9874498474cec32634cf281ddc453 (diff)
downloadqtwayland-0a62a4623dbce0d3ebda99c6af1a4fd4f6f408e5.tar.gz
Fix crash for destroyed surface on touch event
Change-Id: Ia3dd8627c1b96a88d308dc7fa85d936f809c7856 Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
-rw-r--r--src/client/qwaylandinputdevice.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index 567620ba..e0a5ce94 100644
--- a/src/client/qwaylandinputdevice.cpp
+++ b/src/client/qwaylandinputdevice.cpp
@@ -253,6 +253,8 @@ void QWaylandInputDevice::handleWindowDestroyed(QWaylandWindow *window)
mKeyboard->mFocus = 0;
mKeyboard->stopRepeat();
}
+ if (mTouch && window == mTouch->mFocus)
+ mTouch->mFocus = 0;
}
void QWaylandInputDevice::setDataDevice(QWaylandDataDevice *device)
@@ -739,6 +741,9 @@ void QWaylandInputDevice::Touch::touch_down(uint32_t serial,
wl_fixed_t x,
wl_fixed_t y)
{
+ if (!surface)
+ return;
+
mParent->mTime = time;
mParent->mSerial = serial;
mFocus = QWaylandWindow::fromWlSurface(surface);