Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package qt6-wayland for openSUSE:Factory 
checked in at 2024-07-17 15:13:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/qt6-wayland (Old)
 and      /work/SRC/openSUSE:Factory/.qt6-wayland.new.17339 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "qt6-wayland"

Wed Jul 17 15:13:47 2024 rev:36 rq:1187796 version:6.7.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/qt6-wayland/qt6-wayland.changes  2024-07-10 
16:47:55.824125894 +0200
+++ /work/SRC/openSUSE:Factory/.qt6-wayland.new.17339/qt6-wayland.changes       
2024-07-17 15:14:13.052027312 +0200
@@ -1,0 +2,8 @@
+Tue Jul 16 09:02:13 UTC 2024 - Fabian Vogt <fv...@suse.com>
+
+- Add patches to fix crashes on screens disappearing
+  (kde#489072, kde#489180):
+  * 0001-client-Guard-against-windows-being-on-a-null-screen.patch
+  * 0002-Client-Improve-thread-safety-determining-window-size.patch
+
+-------------------------------------------------------------------

New:
----
  0001-client-Guard-against-windows-being-on-a-null-screen.patch
  0002-Client-Improve-thread-safety-determining-window-size.patch

BETA DEBUG BEGIN:
  New:  (kde#489072, kde#489180):
  * 0001-client-Guard-against-windows-being-on-a-null-screen.patch
  * 0002-Client-Improve-thread-safety-determining-window-size.patch
  New:  * 0001-client-Guard-against-windows-being-on-a-null-screen.patch
  * 0002-Client-Improve-thread-safety-determining-window-size.patch
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ qt6-wayland.spec ++++++
--- /var/tmp/diff_new_pack.0mVmCr/_old  2024-07-17 15:14:13.568046029 +0200
+++ /var/tmp/diff_new_pack.0mVmCr/_new  2024-07-17 15:14:13.568046029 +0200
@@ -40,6 +40,9 @@
 Source99:       qt6-wayland-rpmlintrc
 # PATCH-FIX-UPSTREAM
 Patch1:         0001-Client-Ensure-that-guessed-popup-parent-has-a-shell-.patch
+Patch2:         0001-client-Guard-against-windows-being-on-a-null-screen.patch
+# https://codereview.qt-project.org/c/qt/qtwayland/+/574983
+Patch3:         0002-Client-Improve-thread-safety-determining-window-size.patch
 BuildRequires:  pkgconfig
 BuildRequires:  qt6-core-private-devel
 BuildRequires:  qt6-gui-private-devel
@@ -165,7 +168,6 @@
 This package contains enabled features information shared by all the
 qt6-wayland libraries.
 
-
 ### Private only libraries ###
 
 %package -n libQt6WaylandEglClientHwIntegration6

++++++ 0001-client-Guard-against-windows-being-on-a-null-screen.patch ++++++
>From 8811c62a0c31443ee888a67df2e960bc040f3dcc Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmund...@kde.org>
Date: Wed, 10 Jul 2024 09:00:33 +0100
Subject: [PATCH 1/2] client: Guard against windows being on a null screen

calculateScreenFromSurfaceEvents uses the screen information from our
surface enter events. If this is not set yet, or refers to outputs not
yet complete we fall back to the QWindow::screen. This was introduced in
e03613524fc9f6be5c4cd7e9bdb00bc09c7f1e0b.

It was assumed that this would always be a valid value as QtBase keeps
it updated, but there are apparently paths for it to still be null.

It will be evaluated again when the surface receives a wl_enter event or
the output that we have entered is finally initialised and we will then
be marked as on the correct screen.

Change-Id: I33b4a5112c3426a8ea523d39a0658ba7ffee5298
Reviewed-by: Aleix Pol Gonzalez <aleix...@kde.org>
Reviewed-by: Vlad Zahorodnii <vlad.zahorod...@kde.org>
(cherry picked from commit c4f91b479303dda2e49499de249018d7c66c5f99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_...@qt-project.org>
(cherry picked from commit ec07c90cd647fd7a647f3f10dcae4d18699263df)
(cherry picked from commit 406995207eae8d644b6e5262aa716a48c7e471a8)
---
 src/client/qwaylandwindow.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 22aeba10..c64f3326 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -1405,7 +1405,7 @@ void QWaylandWindow::handleScreensChanged()
 {
     QPlatformScreen *newScreen = calculateScreenFromSurfaceEvents();
 
-    if (newScreen->screen() == window()->screen())
+    if (!newScreen || newScreen->screen() == window()->screen())
         return;
 
     QWindowSystemInterface::handleWindowScreenChanged(window(), 
newScreen->QPlatformScreen::screen());
-- 
2.45.2


++++++ 0002-Client-Improve-thread-safety-determining-window-size.patch ++++++
>From be646fd42892d6e59a573a0a188c5ae193d2be83 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmund...@kde.org>
Date: Fri, 5 Jul 2024 16:13:40 +0100
Subject: [PATCH 2/2] Client: Improve thread safety determining window size on
 the render thread

updateSurface is called from both the render and GUI thread. We
therefore need every property referenced to be thread safe.

Rather than guarding each property we cache the buffer size whenever the
window geometry or scale changes and put a mutex round this one
variable.

Change-Id: I4168ced27556e0e4558bbdbd1daa275d7523c33d
Reviewed-by: Vlad Zahorodnii <vlad.zahorod...@kde.org>
(cherry picked from commit 83da29c62f8fb918df8d91826d16b5d5ceb2c704)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_...@qt-project.org>
(cherry picked from commit f817608c7152487f489d0f3a227c1d0ceb7b0c2c)
---
 .../client/wayland-egl/qwaylandeglwindow.cpp  | 20 +++++++++++++++----
 .../client/wayland-egl/qwaylandeglwindow_p.h  |  6 ++++++
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp 
b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
index e6258893..d020f4db 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
@@ -50,6 +50,15 @@ QWaylandWindow::WindowType QWaylandEglWindow::windowType() 
const
 
 void QWaylandEglWindow::ensureSize()
 {
+    // this is always called on the main thread
+    QMargins margins = mWindowDecoration ? frameMargins() : QMargins{};
+    QRect rect = geometry();
+    QSize sizeWithMargins = (rect.size() + QSize(margins.left() + 
margins.right(), margins.top() + margins.bottom())) * scale();
+    {
+        QWriteLocker lock(&m_bufferSizeLock);
+        m_bufferSize = sizeWithMargins;
+    }
+
     updateSurface(false);
 }
 
@@ -60,14 +69,17 @@ void QWaylandEglWindow::setGeometry(const QRect &rect)
     // we're now getting a resize we don't want to create it again.
     // Just resize the wl_egl_window, the EGLSurface will be created
     // the next time makeCurrent is called.
-    updateSurface(false);
+    ensureSize();
 }
 
 void QWaylandEglWindow::updateSurface(bool create)
 {
-    QMargins margins = mWindowDecoration ? frameMargins() : QMargins{};
-    QRect rect = geometry();
-    QSize sizeWithMargins = (rect.size() + QSize(margins.left() + 
margins.right(), margins.top() + margins.bottom())) * scale();
+
+    QSize sizeWithMargins;
+    {
+        QReadLocker lock(&m_bufferSizeLock);
+        sizeWithMargins = m_bufferSize;
+    }
 
     // wl_egl_windows must have both width and height > 0
     // mesa's egl returns NULL if we try to create a, invalid wl_egl_window, 
however not all EGL
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow_p.h 
b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow_p.h
index 5b9aa987..048f0b61 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow_p.h
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow_p.h
@@ -60,7 +60,13 @@ private:
     mutable QOpenGLFramebufferObject *m_contentFBO = nullptr;
 
     QSurfaceFormat m_format;
+    // Size used in the last call to wl_egl_window_resize
     QSize m_requestedSize;
+
+    // Size of the buffer used by QWaylandWindow
+    // This is always written to from the main thread, potentially read from 
the rendering thread
+    QReadWriteLock m_bufferSizeLock;
+    QSize m_bufferSize;
 };
 
 }
-- 
2.45.2

Reply via email to