Client: Send subsurface expose event when toplevel is configured

If a subsurface is set to be visible on the cilent side before the top
level is configured it will do not create an exposeEvent and map a
buffer as we fail the check in isExposed() where we check the parent.
This is correct behavior.

However, when the toplevel receives an applyConfigure from the shell
client we need subsurfaces to update accordingly.

This fixes a race where subsurfaces are not shown with slow compositors.

Change-Id: Icd156e7655d5b25535acc4d2fe77c31e19ebfa32
Pick-to: 5.15
Fixes: QTBUG-86176
Reviewed-by: David Edmundson <davidedmundson@kde.org>
This commit is contained in:
David Edmundson 2020-07-26 17:56:25 +01:00
parent 8631b43a2d
commit 6d8b4bbadb
2 changed files with 14 additions and 1 deletions

View File

@ -516,10 +516,22 @@ void QWaylandWindow::applyConfigure()
doApplyConfigure();
lock.unlock();
sendExposeEvent(QRect(QPoint(), geometry().size()));
sendRecursiveExposeEvent();
QWindowSystemInterface::flushWindowSystemEvents();
}
void QWaylandWindow::sendRecursiveExposeEvent()
{
if (!window()->isVisible())
return;
sendExposeEvent(QRect(QPoint(), geometry().size()));
for (QWaylandSubSurface *subSurface : qAsConst(mChildren)) {
auto subWindow = subSurface->window();
subWindow->sendRecursiveExposeEvent();
}
}
void QWaylandWindow::attach(QWaylandBuffer *buffer, int x, int y)
{
Q_ASSERT(!buffer->committed());

View File

@ -271,6 +271,7 @@ private:
void handleMouseEventWithDecoration(QWaylandInputDevice *inputDevice, const QWaylandPointerEvent &e);
void handleScreensChanged();
void sendRecursiveExposeEvent();
bool mInResizeFromApplyConfigure = false;
bool lastVisible = false;