wayland: check screen isPlaceholder and if wl_output is null

Fixes crashes on disconnected monitors
This commit is contained in:
Bryan Paradis authored and outfoxxed committed 2026-02-22 19:27:26 -08:00
1 parent e7cd1e9982
commit 158db16b93
3 files changed
+4 -3

No files matched your search

+2 -2
View File
@@ -143,11 +143,11 @@ LayerSurface::LayerSurface(LayerShellIntegration* shell, QtWaylandClient::QWayla
auto* waylandScreen =
dynamic_cast<QtWaylandClient::QWaylandScreen*>(qwindow->screen()->handle());
if (waylandScreen != nullptr) {
if (waylandScreen != nullptr && !waylandScreen->isPlaceholder() && waylandScreen->output()) {
output = waylandScreen->output();
} else {
qWarning()
<< "Layershell screen does not corrospond to a real screen. Letting the compositor pick.";
<< "Layershell screen does not correspond to a real screen. Letting the compositor pick.";
}
}