diff --git a/dev-qt/qtwayland/files/qtwayland-6.9.0-reset-mframe.patch b/dev-qt/qtwayland/files/qtwayland-6.9.0-reset-mframe.patch new file mode 100644 index 0000000000000..bad4ad4e329a9 --- /dev/null +++ b/dev-qt/qtwayland/files/qtwayland-6.9.0-reset-mframe.patch @@ -0,0 +1,60 @@ +Backport recommended by KDE[1]. + +[1] https://invent.kde.org/qt/qt/qtwayland/-/commit/e4556c59f0c8250da7c16759432b2ac0a5ac9d9f +[2] https://mail.kde.org/pipermail/distributions/2025-April/001575.html +From e4556c59f0c8250da7c16759432b2ac0a5ac9d9f Mon Sep 17 00:00:00 2001 +From: Vlad Zahorodnii +Date: Mon, 31 Mar 2025 11:40:12 +0300 +Subject: [PATCH] Client: Reset mFrameCallbackTimedOut when showing a window + +When a window is hidden, the corresponding expose event is sent +asynchronously. So, a buffer (and a frame callback) can be attached +after the window is hidden. + +QWaylandWindow::initWindow() handles that case by attaching a nil buffer +to the surface, but it skips resetting the frame callback things. + +If mFrameCallbackTimedOut is not reset, then the window can get stuck +in the unexposed state and not show up after the second setVisible(true). + +This change makes the initWindow() function also reset frame callback +data. It fixes some windows not showing up after remapping them. +--- a/src/client/qwaylandwindow.cpp ++++ b/src/client/qwaylandwindow.cpp +@@ -107,4 +107,5 @@ + mSurface->attach(nullptr, 0, 0); + mSurface->commit(); ++ resetFrameCallback(); + + if (window()->type() == Qt::Desktop) +@@ -326,4 +327,13 @@ + delete std::exchange(mSubSurfaceWindow, nullptr); + emit surfaceRoleDestroyed(); ++ ++ resetFrameCallback(); ++ mInFrameRender = false; ++ mWaitingToApplyConfigure = false; ++ mExposed = false; ++} ++ ++void QWaylandWindow::resetFrameCallback() ++{ + { + QMutexLocker lock(&mFrameSyncMutex); +@@ -339,8 +349,5 @@ + mFrameCallbackCheckIntervalTimerId = -1; + } +- mInFrameRender = false; + mFrameCallbackTimedOut = false; +- mWaitingToApplyConfigure = false; +- mExposed = false; + } + +--- a/src/client/qwaylandwindow_p.h ++++ b/src/client/qwaylandwindow_p.h +@@ -352,4 +352,5 @@ + bool shouldCreateSubSurface() const; + void resetSurfaceRole(); ++ void resetFrameCallback(); + QPlatformScreen *calculateScreenFromSurfaceEvents() const; + void setOpaqueArea(const QRegion &opaqueArea); diff --git a/dev-qt/qtwayland/qtwayland-6.9.0.ebuild b/dev-qt/qtwayland/qtwayland-6.9.0-r1.ebuild similarity index 96% rename from dev-qt/qtwayland/qtwayland-6.9.0.ebuild rename to dev-qt/qtwayland/qtwayland-6.9.0-r1.ebuild index 65d678304c2bc..ef9a53788591f 100644 --- a/dev-qt/qtwayland/qtwayland-6.9.0.ebuild +++ b/dev-qt/qtwayland/qtwayland-6.9.0-r1.ebuild @@ -47,6 +47,10 @@ CMAKE_SKIP_TESTS=( tst_scaling ) +PATCHES=( + "${FILESDIR}"/${P}-reset-mframe.patch +) + src_configure() { local mycmakeargs=( $(cmake_use_find_package compositor Qt6Quick)