Set pointer focus to null when surface is destroyed.
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>
Fri, 3 Feb 2012 08:30:40 +0000 (10:30 +0200)
committerJørgen Lind <jorgen.lind@nokia.com>
Fri, 3 Feb 2012 08:53:25 +0000 (09:53 +0100)
We must do something otherwise the next inputDevice->mouseFocus() call
will dereference an already deleted instance.

Change-Id: I3ac92a37715f63c6dc43191968a8da51befbccde
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
src/compositor/wayland_wrapper/wlcompositor.cpp

index 830cb29..b28f8f8 100644 (file)
@@ -248,6 +248,8 @@ void Compositor::processWaylandEvents()
 
 void Compositor::surfaceDestroyed(Surface *surface)
 {
+    if (defaultInputDevice()->mouseFocus() == surface)
+        defaultInputDevice()->setMouseFocus(0, QPoint(), QPoint());
     m_surfaces.removeOne(surface);
     m_dirty_surfaces.remove(surface);
     if (m_directRenderSurface == surface)