aports/community/qt6-qtwayland/0002-qt6-qtwayland-client-guard-against-windows-being-on-a-null-screen.patch
Bart Ribbers 40b6961c18 community/qt6-qtwayland: backport fixes to prevent Plasma from crashing
To be released in Qt 6.7.3 but KDE requested us to ship it earlier
2024-08-06 16:11:35 +02:00

44 lines
1.8 KiB
Diff

From 406995207eae8d644b6e5262aa716a48c7e471a8 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Wed, 10 Jul 2024 09:00:33 +0100
Subject: [PATCH] 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 <aleixpol@kde.org>
Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
(cherry picked from commit c4f91b479303dda2e49499de249018d7c66c5f99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ec07c90cd647fd7a647f3f10dcae4d18699263df)
---
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 c3725ffc9..192373184 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -1407,7 +1407,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());
--
GitLab