diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2018-08-24 13:03:09 +0200 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2018-09-05 11:23:56 +0000 |
commit | c3b6c4d442c8187e43601c548bc58ce3e4fe21f3 (patch) | |
tree | fdcf4b4eacc4858360d4b6764aacc2d516e82cef | |
parent | 53dff95bfbe9070c4cd17045f3d5147f29710c5f (diff) | |
download | qtwayland-c3b6c4d442c8187e43601c548bc58ce3e4fe21f3.tar.gz |
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 <paul.tvete@qt.io>
-rw-r--r-- | src/compositor/compositor_api/qwaylandoutput.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compositor/compositor_api/qwaylandoutput.cpp b/src/compositor/compositor_api/qwaylandoutput.cpp index f7782da9..415d08f1 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); } /*! |