diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2012-05-10 15:19:04 +0300 |
---|---|---|
committer | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2012-05-10 19:15:08 +0200 |
commit | c835ca4d8d8101fdab61d5d98910ffbed4b7c1e1 (patch) | |
tree | 1556740e232b301b9e85e78e0295752bbb9a85c3 /src/compositor/wayland_wrapper/wlcompositor.cpp | |
parent | e0054c0b6dd9f2a30f1195f8fd13426f2b358f57 (diff) |
Make sure the pointer focus is really reset when destroying
Using the grab interface introduced an issue which crashes the
compositor quite often when running widget apps.
Change-Id: I74b64fb7b18ec510773b3b533a3c778be7173db4
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/compositor/wayland_wrapper/wlcompositor.cpp')
-rw-r--r-- | src/compositor/wayland_wrapper/wlcompositor.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/compositor/wayland_wrapper/wlcompositor.cpp b/src/compositor/wayland_wrapper/wlcompositor.cpp index df1969802..9f00045da 100644 --- a/src/compositor/wayland_wrapper/wlcompositor.cpp +++ b/src/compositor/wayland_wrapper/wlcompositor.cpp @@ -271,8 +271,14 @@ void Compositor::processWaylandEvents() void Compositor::surfaceDestroyed(Surface *surface) { - if (defaultInputDevice()->mouseFocus() == surface) - defaultInputDevice()->setMouseFocus(0, QPoint(), QPoint()); + if (defaultInputDevice()->mouseFocus() == surface) { + InputDevice *dev = defaultInputDevice(); + dev->setMouseFocus(0, QPointF(), QPointF()); + // Make sure the surface is reset regardless of what the grabber + // interface's focus() does. (e.g. the default implementation does + // nothing when a button is down which would be disastrous here) + wl_input_device_set_pointer_focus(dev->base(), 0, 0, 0); + } m_surfaces.removeOne(surface); m_dirty_surfaces.remove(surface); if (m_directRenderSurface == surface) |