From 6d6fc53e71e4b92ca61b7db2b446c3f4b14157d8 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Mon, 6 Mar 2023 01:11:45 +0100 Subject: client: Do not cast placeholder screens to QWaylandScreen It's wrong to C-cast an object to a class that isn't theirs. Check if it is a placeholder first. Change-Id: I45d3c423422ae6638a033fb0f4cfefc7cd4460f0 Reviewed-by: Eskil Abrahamsen Blomfeldt Reviewed-by: David Edmundson (cherry picked from commit a53f022393a1276dbf8eccbae04cb0bd6cea0160) Reviewed-by: Qt Cherry-pick Bot --- src/client/qwaylandnativeinterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/qwaylandnativeinterface.cpp b/src/client/qwaylandnativeinterface.cpp index 2c1cdb98..65272f3c 100644 --- a/src/client/qwaylandnativeinterface.cpp +++ b/src/client/qwaylandnativeinterface.cpp @@ -159,7 +159,7 @@ void *QWaylandNativeInterface::nativeResourceForScreen(const QByteArray &resourc { QByteArray lowerCaseResource = resourceString.toLower(); - if (lowerCaseResource == "output") + if (lowerCaseResource == "output" && !screen->handle()->isPlaceholder()) return ((QWaylandScreen *) screen->handle())->output(); return nullptr; -- cgit v1.2.1