From d338d7c9fb6a2e61173fa3e3b158277c71102e0d Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 8 Dec 2023 14:46:44 +0000 Subject: [PATCH] Handle subsurfaces with async configure With XDG Shell we cannot map a buffer until we get a configure event. To handle this the normal expose events is blocked then sent explicitly when we get this request. This works, but we also need to notify that subsurfaces are now exposed with the parent. Pick-to: 6.7 6.6 6.5 Fixes: QTBUG-119882 Fixes: QTBUG-119883 Change-Id: I0ae69c8da702037e7575cfc0939d3e783b50f323 Reviewed-by: Liang Qi --- .../plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | 2 +- src/plugins/platforms/wayland/qwaylandwindow_p.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp index a2728bd923c..d1f0a9b08d5 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -606,7 +606,7 @@ void QWaylandXdgSurface::xdg_surface_configure(uint32_t serial) // We have to do the initial applyConfigure() immediately, since that is the expose. applyConfigure(); if (isExposed()) - m_window->handleExpose(QRect(QPoint(), m_window->geometry().size())); + m_window->sendRecursiveExposeEvent(); } else { // Later configures are probably resizes, so we have to queue them up for a time when we // are not painting to the window. diff --git a/src/plugins/platforms/wayland/qwaylandwindow_p.h b/src/plugins/platforms/wayland/qwaylandwindow_p.h index aa125e6eab4..1ed4ce79f9a 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow_p.h +++ b/src/plugins/platforms/wayland/qwaylandwindow_p.h @@ -232,6 +232,7 @@ public: void endFrame(); void closeChildPopups(); + void sendRecursiveExposeEvent(); virtual void reinit(); void reset(); @@ -353,7 +354,6 @@ private: void handleScreensChanged(); void updateScale(); void setScale(qreal newScale); - void sendRecursiveExposeEvent(); QWaylandWindow *guessTransientParent() const; void addChildPopup(QWaylandWindow *child);