From 04ccf04596a0c0e95e5c520af87745dfb3425dd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 23 Mar 2016 17:01:39 +0100 Subject: [PATCH] [server] Add a workaround for a freeze in QtWayland Summary: See: https://bugreports.qt.io/browse/QTBUG-52092 Freeze happens if a sub-surface is rendered to before the main surface is rendered. The compositor has no chance to know that this is a window which needs to be rendered, thus the application might freeze without ever becoming visible. Famous example applications being affected: all kcms with a nested QQuickView. E.g.: kcmshell5 kwineffects Reviewers: #plasma Subscribers: plasma-devel Projects: #plasma Differential Revision: https://phabricator.kde.org/D1208 --- src/wayland/surface_interface.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wayland/surface_interface.cpp b/src/wayland/surface_interface.cpp index 8338f8da56..82d48469fe 100644 --- a/src/wayland/surface_interface.cpp +++ b/src/wayland/surface_interface.cpp @@ -338,6 +338,11 @@ void SurfaceInterface::Private::swapStates(State *source, State *target, bool em target->damage = windowRegion.intersected(target->damage); if (emitChanged) { emit q->damaged(target->damage); + // workaround for https://bugreports.qt.io/browse/QTBUG-52092 + // if the surface is a sub-surface, but the main surface is not yet mapped, fake frame rendered + if (subSurface && !subSurface->mainSurface()->buffer()) { + q->frameRendered(0); + } } } } else if (!target->buffer && emitChanged) {