From 25af63583b5e9b040d71d672e0550514a52678b5 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 11 May 2012 08:56:06 +0300 Subject: [PATCH] Do not assert in pointer and keyboard enter MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/plugins/platforms/wayland/qwaylandinputdevice.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; -- 2.7.4