From 7d7ac7f0a4bd6a7956448ddb0ba44c12755dca2e Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Sun, 26 Jul 2020 17:56:25 +0100 Subject: 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 Fixes: QTBUG-86176 Reviewed-by: David Edmundson (cherry picked from commit e20e1d506d627a53d9d7bf7794b93bf9e8b9bedb) Reviewed-by: Qt Cherry-pick Bot --- src/client/qwaylandwindow.cpp | 14 +++++++++++++- src/client/qwaylandwindow_p.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 2e0614ec9..7c2815f68 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -518,10 +518,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()); diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h index be06e435f..948e0ea7a 100644 --- a/src/client/qwaylandwindow_p.h +++ b/src/client/qwaylandwindow_p.h @@ -271,6 +271,7 @@ private: void handleMouseEventWithDecoration(QWaylandInputDevice *inputDevice, const QWaylandPointerEvent &e); void handleScreensChanged(); + void sendRecursiveExposeEvent(); bool mInResizeFromApplyConfigure = false; bool lastVisible = false; -- cgit v1.2.3