summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wayland/qwaylandinputdevice.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2012-04-13 12:22:14 +0300
committerJørgen Lind <jorgen.lind@nokia.com>2012-04-17 13:09:16 +0200
commit6ec82c38f0ed751d2e7c67c0732d2d5c043c4a84 (patch)
tree7c3be4666c17c3da955ffe97879a68b4b6da79f1 /src/plugins/platforms/wayland/qwaylandinputdevice.cpp
parent801b800cd2baffa9d3080ec3184ffd1af6b9bde8 (diff)
Do not assert when closing dialogs
The leave event may arrive after the window is gone, resulting in a null surface. The callback should do nothing in this case. Change-Id: I36ec4cb1615f518de57b7de98206cdb8986405e4 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'src/plugins/platforms/wayland/qwaylandinputdevice.cpp')
-rw-r--r--src/plugins/platforms/wayland/qwaylandinputdevice.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp
index 2be5946b2..7ac47f9a9 100644
--- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp
+++ b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp
@@ -362,7 +362,7 @@ void QWaylandInputDevice::inputHandlePointerEnter(void *data,
Q_UNUSED(sy);
QWaylandInputDevice *inputDevice = (QWaylandInputDevice *) data;
- // shouldn't get pointer leave with no surface
+ // shouldn't get pointer enter with no surface
Q_ASSERT(surface);
QWaylandWindow *window = (QWaylandWindow *) wl_surface_get_user_data(surface);
@@ -379,8 +379,10 @@ void QWaylandInputDevice::inputHandlePointerLeave(void *data,
Q_UNUSED(input_device);
QWaylandInputDevice *inputDevice = (QWaylandInputDevice *) data;
- // shouldn't get pointer leave with no surface
- Q_ASSERT(surface);
+ // The event may arrive after destroying the window, indicated by
+ // a null surface.
+ if (!surface)
+ return;
QWaylandWindow *window = (QWaylandWindow *) wl_surface_get_user_data(surface);
window->handleMouseLeave();