summaryrefslogtreecommitdiff
path: root/src/compositor
diff options
context:
space:
mode:
authorKai Uwe Broulik <kde@privat.broulik.de>2021-08-02 19:37:26 +0200
committerKai Uwe Broulik <kde@privat.broulik.de>2021-08-10 14:57:54 +0200
commit8ef15a868c6135cb5d00ef4b1db89e3b06fd9870 (patch)
tree87285050279c41d2a68109356cade304eb121163 /src/compositor
parent3c04dd8b26e276ae7649021135496d1ed3b111f1 (diff)
downloadqtwayland-8ef15a868c6135cb5d00ef4b1db89e3b06fd9870.tar.gz
QWaylandQuickItem: Invoke handleSubsurfaceAdded also with QVariant
Docs for WaylandQuickItem subsurfaceHandler suggest you use it like so: subsurfaceHandler: QtObject { function handleSubsurfaceAdded(child) { ... } } However, as far as C++ is concerned all arguments of a JavaScript function are QVariant, so the type-specific invocation fails. Change-Id: I2d1a32bef5b30099cf34edc8a9e50b42fb26f217 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/compositor')
-rw-r--r--src/compositor/compositor_api/qwaylandquickitem.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp
index 708baf36..bf165b15 100644
--- a/src/compositor/compositor_api/qwaylandquickitem.cpp
+++ b/src/compositor/compositor_api/qwaylandquickitem.cpp
@@ -846,6 +846,10 @@ void QWaylandQuickItem::handleSubsurfaceAdded(QWaylandSurface *childSurface)
} else {
bool success = QMetaObject::invokeMethod(d->subsurfaceHandler, "handleSubsurfaceAdded", Q_ARG(QWaylandSurface *, childSurface));
if (!success)
+ success = QMetaObject::invokeMethod(d->subsurfaceHandler, "handleSubsurfaceAdded",
+ Q_ARG(QVariant, QVariant::fromValue(childSurface)));
+
+ if (!success)
qWarning("QWaylandQuickItem: subsurfaceHandler does not implement handleSubsurfaceAdded()");
}
}