From: Laszlo Agocs Date: Fri, 11 May 2012 05:56:06 +0000 (+0300) Subject: Do not assert in pointer and keyboard enter X-Git-Tag: TIZEN~43 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=25af63583b5e9b040d71d672e0550514a52678b5;p=profile%2Fivi%2Fqtwayland.git Do not assert in pointer and keyboard enter Handle the case of null surface gracefully. It can be null if the surface is destroyed on client side and the object is in zombie state still. Change-Id: Ife67180e6405a521562a43c24d377559d7848b6f Reviewed-by: Samuel Rødal --- diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp index 4a92b6f..7cfe56d 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp +++ b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp @@ -399,8 +399,8 @@ void QWaylandInputDevice::inputHandlePointerEnter(void *data, Q_UNUSED(sy); QWaylandInputDevice *inputDevice = (QWaylandInputDevice *) data; - // shouldn't get pointer enter with no surface - Q_ASSERT(surface); + if (!surface) + return; QWaylandWindow *window = (QWaylandWindow *) wl_surface_get_user_data(surface); window->handleMouseEnter(); @@ -447,8 +447,8 @@ void QWaylandInputDevice::inputHandleKeyboardEnter(void *data, inputDevice->mModifiers |= translateModifiers(inputDevice->mXkbState); #endif - // shouldn't get keyboard enter with no surface - Q_ASSERT(surface); + if (!surface) + return; window = (QWaylandWindow *) wl_surface_get_user_data(surface); inputDevice->mKeyboardFocus = window;