From 19c03da560ac99b005847d01a77b66336315713e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 3 Jun 2015 21:16:53 +0200 Subject: [PATCH] [server] Don't discard callbacks on surface commit Old callbacks need to be kept around, otherwise mesa might freeze. --- src/wayland/surface_interface.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wayland/surface_interface.cpp b/src/wayland/surface_interface.cpp index 31e2be1983..f97728b439 100644 --- a/src/wayland/surface_interface.cpp +++ b/src/wayland/surface_interface.cpp @@ -174,9 +174,6 @@ void SurfaceInterface::Private::destroy() void SurfaceInterface::Private::commit() { Q_Q(SurfaceInterface); - for (wl_resource *c : current.callbacks) { - wl_resource_destroy(c); - } const bool bufferChanged = pending.bufferIsSet; const bool opaqueRegionChanged = pending.opaqueIsSet; const bool inputRegionChanged = pending.inputIsSet; @@ -199,9 +196,12 @@ void SurfaceInterface::Private::commit() } buffer = pending.buffer; } + QList callbacks = current.callbacks; + callbacks.append(pending.callbacks); // copy values current = pending; current.buffer = buffer; + current.callbacks = callbacks; pending = State{}; pending.children = current.children; pending.input = current.input;