From b248defd1741cd443dd1e5050fe5143e8650a7c7 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Sat, 19 Mar 2016 15:36:22 +0100 Subject: Compositor API: Add closeAllPopups method to QWaylandWlShell The WlShell implementation now matches xdg shell. Also adds a convenience method to QWaylandWlShell to get all popups. QWaylandWlShellIntegration and qwindow-compositor uses this new API. Change-Id: Ibfe3323ad7f56d43379785582b9be6801905a485 Reviewed-by: Pier Luigi Fiorini --- src/compositor/extensions/qwaylandxdgshellv5.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/compositor/extensions/qwaylandxdgshellv5.cpp') diff --git a/src/compositor/extensions/qwaylandxdgshellv5.cpp b/src/compositor/extensions/qwaylandxdgshellv5.cpp index 284aa8b05..a14f58e05 100644 --- a/src/compositor/extensions/qwaylandxdgshellv5.cpp +++ b/src/compositor/extensions/qwaylandxdgshellv5.cpp @@ -531,6 +531,16 @@ void QWaylandXdgShellV5::initialize() this, &QWaylandXdgShellV5::handleSeatChanged); } +QWaylandClient *QWaylandXdgShellV5::popupClient() const +{ + Q_D(const QWaylandXdgShellV5); + Q_FOREACH (QWaylandXdgPopupV5 *popup, d->m_xdgPopups) { + if (popup->surface()->hasContent()) + return popup->surface()->client(); + } + return nullptr; +} + /*! * Returns the Wayland interface for the QWaylandXdgShellV5. */ -- cgit v1.2.3