summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2023-03-06 01:11:45 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2023-03-06 09:13:55 +0000
commita53f022393a1276dbf8eccbae04cb0bd6cea0160 (patch)
treeafdcf892456316f6091da8e689f5f6ffbfad66f1 /src
parent6ffff6b50be77cda196851fe81e30445e8a1e723 (diff)
downloadqtwayland-a53f022393a1276dbf8eccbae04cb0bd6cea0160.tar.gz
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. Pick-to: 5.15 6.2 6.5 Change-Id: I45d3c423422ae6638a033fb0f4cfefc7cd4460f0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'src')
-rw-r--r--src/client/qwaylandnativeinterface.cpp2
1 files changed, 1 insertions, 1 deletions
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;