From c3b6c4d442c8187e43601c548bc58ce3e4fe21f3 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 24 Aug 2018 13:03:09 +0200 Subject: Compositor: Don't send illegal leave events If a client doesn't bind to an output, don't try to send leave events for it. ...similarly to how we don't send enter events for it. weston-simple-egl is one such client. [ChangeLog][Compositor] Fixed a bug that caused some clients to abort in libwayland when a surface left an output. Change-Id: Ia7f4c21a7d766092dfb8a20c56fa1128a3046f97 Reviewed-by: Paul Olav Tvete --- src/compositor/compositor_api/qwaylandoutput.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compositor/compositor_api/qwaylandoutput.cpp b/src/compositor/compositor_api/qwaylandoutput.cpp index f7782da9c..415d08f16 100644 --- a/src/compositor/compositor_api/qwaylandoutput.cpp +++ b/src/compositor/compositor_api/qwaylandoutput.cpp @@ -915,7 +915,10 @@ void QWaylandOutput::surfaceLeave(QWaylandSurface *surface) { if (!surface || !surface->client()) return; - QWaylandSurfacePrivate::get(surface)->send_leave(resourceForClient(surface->client())); + + auto *clientResource = resourceForClient(surface->client()); + if (clientResource) + QWaylandSurfacePrivate::get(surface)->send_leave(clientResource); } /*! -- cgit v1.2.3