qt5-qtwayland/qtwayland-client-send-subsurface-expose-event-when-toplevel-is-configured.patch
2020-07-27 10:55:57 +02:00

60 lines
2.0 KiB
Diff

From e87bc5eda5191dfec9c8bdfdcd67faf15e79d1d1 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Sun, 26 Jul 2020 17:56:25 +0100
Subject: [PATCH] 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
---
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index f7647a4..9669cbb 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -517,10 +517,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 *subsurf : qAsConst(mChildren)) {
+ auto subWindow = subsurf->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 f2055df..b57f5dd 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -268,6 +268,7 @@ private:
void handleMouseEventWithDecoration(QWaylandInputDevice *inputDevice, const QWaylandPointerEvent &e);
void handleScreensChanged();
+ void sendRecursiveExposeEvent();
bool mInResizeFromApplyConfigure = false;
QRect mLastExposeGeometry;