summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2023-03-06 01:11:45 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-03-06 11:28:18 +0000
commit93ea6555c8d2e1d05fb8dcbd8838bfefd56ae03a (patch)
treed5ff4649a37cbd1dc430fb4eb92d1e7d8bd0fdf1
parent8586ab978d61161f66c3af4ee88022de9e92ff9e (diff)
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 <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit a53f022393a1276dbf8eccbae04cb0bd6cea0160) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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 2b26f4da7..2b0f19e67 100644
--- a/src/client/qwaylandnativeinterface.cpp
+++ b/src/client/qwaylandnativeinterface.cpp
@@ -137,7 +137,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;