[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
This commit is contained in:
Martin Gräßlin 2016-03-23 17:01:39 +01:00
parent 84118fad13
commit 04ccf04596

View file

@ -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) {