summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/wayland/pure-qml/qml/main.qml3
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv5integration.cpp8
2 files changed, 8 insertions, 3 deletions
diff --git a/examples/wayland/pure-qml/qml/main.qml b/examples/wayland/pure-qml/qml/main.qml
index 9bce7bcb..5eece078 100644
--- a/examples/wayland/pure-qml/qml/main.qml
+++ b/examples/wayland/pure-qml/qml/main.qml
@@ -81,7 +81,8 @@ WaylandCompositor {
}
onXdgPopupCreated: {
var parentView = viewsBySurface[xdgPopup.parentSurface];
- chromeComponent.createObject(parentView, { "shellSurface": xdgPopup } );
+ var item = chromeComponent.createObject(parentView, { "shellSurface": xdgPopup } );
+ viewsBySurface[xdgPopup.surface] = item;
}
}
diff --git a/src/compositor/extensions/qwaylandxdgshellv5integration.cpp b/src/compositor/extensions/qwaylandxdgshellv5integration.cpp
index b3170333..e2aa6b3e 100644
--- a/src/compositor/extensions/qwaylandxdgshellv5integration.cpp
+++ b/src/compositor/extensions/qwaylandxdgshellv5integration.cpp
@@ -194,10 +194,14 @@ XdgPopupV5Integration::XdgPopupV5Integration(QWaylandQuickShellSurfaceItem *item
, m_xdgShell(QWaylandXdgPopupV5Private::get(m_xdgPopup)->m_xdgShell)
{
item->setSurface(m_xdgPopup->surface());
- item->moveItem()->setPosition(QPointF(m_xdgPopup->position() * item->view()->output()->scaleFactor()));
+ if (item->view()->output())
+ item->moveItem()->setPosition(QPointF(m_xdgPopup->position() * item->view()->output()->scaleFactor()));
+ else
+ qWarning() << "XdgPopupV5Integration popup item without output" << item;
QWaylandClient *client = m_xdgPopup->surface()->client();
- QWaylandQuickShellEventFilter::startFilter(client, [&]() { m_xdgShell->closeAllPopups(); });
+ auto shell = m_xdgShell;
+ QWaylandQuickShellEventFilter::startFilter(client, [shell]() { shell->closeAllPopups(); });
connect(m_xdgPopup, &QWaylandXdgPopupV5::destroyed, this, &XdgPopupV5Integration::handlePopupDestroyed);
}