summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylanddisplay.cpp
diff options
context:
space:
mode:
authorDavid Redondo <qt@david-redondo.de>2023-07-28 15:44:55 +0200
committerDavid Redondo <qt@david-redondo.de>2023-07-28 19:28:47 +0200
commit475b8e8da52e0c42bcab7f3df21d9e4df4d50bc2 (patch)
tree5dff7d215e24c38ea8e5af4a7edc8169bf3945c0 /src/client/qwaylanddisplay.cpp
parent47293d6e264ed0bebcd906be12fb0dd49831bcf7 (diff)
client: Make sure screens stay virtual siblings during reconnect
The virtual siblings of QWaylandScreen are constructed from the list of screens in QWaylandDisplay. It is important that when a window changes screens due to handleScreenRemoved that the screens are siblings otherwise the platformwindow is destroyed and window becomes hidden. Pick-to: 6.6 Change-Id: I7ceeee4e18fbdfa936fe987441d35b8a5cb1eefd Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'src/client/qwaylanddisplay.cpp')
-rw-r--r--src/client/qwaylanddisplay.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index 03ec75a60..1c399765e 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -421,9 +421,9 @@ void QWaylandDisplay::reconnect()
qDeleteAll(mWaitingScreens);
mWaitingScreens.clear();
- const auto screens = std::exchange(mScreens, {});
- ensureScreen();
- for (QWaylandScreen *screen : screens) {
+ while (!mScreens.isEmpty()) {
+ auto screen = mScreens.takeLast();
+ ensureScreen();
QWindowSystemInterface::handleScreenRemoved(screen);
}