From 14d37a53a674d7dbef32e718ae391e265fad5fac Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Thu, 9 May 2019 16:07:36 +0200 Subject: Add QWaylandXdgPopup::sendPopupDone ...and one for QWaylandXdgPopupV6. We already have similar API for xdg-shell v5. [ChangeLog][Compositor] Added QWaylandXdgPopup::sendPopupDone, which will dismiss a popup. Fixes: QTBUG-75652 Change-Id: I9c36ee38ee606016587ab88d5b015f29594019e1 Reviewed-by: Pier Luigi Fiorini --- src/compositor/extensions/qwaylandxdgshell.cpp | 20 ++++++++++++++++++++ src/compositor/extensions/qwaylandxdgshell.h | 1 + src/compositor/extensions/qwaylandxdgshellv6.cpp | 20 ++++++++++++++++++++ src/compositor/extensions/qwaylandxdgshellv6.h | 1 + 4 files changed, 42 insertions(+) diff --git a/src/compositor/extensions/qwaylandxdgshell.cpp b/src/compositor/extensions/qwaylandxdgshell.cpp index eb7b958b4..f06fd7934 100644 --- a/src/compositor/extensions/qwaylandxdgshell.cpp +++ b/src/compositor/extensions/qwaylandxdgshell.cpp @@ -1870,6 +1870,26 @@ uint QWaylandXdgPopup::sendConfigure(const QRect &geometry) return d->sendConfigure(geometry); } +/*! + * \qmlmethod void QtWaylandCompositor::XdgPopup::sendPopupDone() + * \since 5.14 + * + * Dismiss the popup. According to the \c xdg-shell protocol this should make the + * client destroy the popup. + */ + +/*! + * \since 5.14 + * + * Dismiss the popup. According to the \c xdg-shell protocol this should make the + * client destroy the popup. + */ +void QWaylandXdgPopup::sendPopupDone() +{ + Q_D(QWaylandXdgPopup); + d->send_popup_done(); +} + /*! * Returns the surface role for the QWaylandPopup. */ diff --git a/src/compositor/extensions/qwaylandxdgshell.h b/src/compositor/extensions/qwaylandxdgshell.h index 774dd2282..f45038eb9 100644 --- a/src/compositor/extensions/qwaylandxdgshell.h +++ b/src/compositor/extensions/qwaylandxdgshell.h @@ -260,6 +260,7 @@ public: QPoint unconstrainedPosition() const; Q_INVOKABLE uint sendConfigure(const QRect &geometry); + Q_REVISION(14) Q_INVOKABLE void sendPopupDone(); static QWaylandSurfaceRole *role(); diff --git a/src/compositor/extensions/qwaylandxdgshellv6.cpp b/src/compositor/extensions/qwaylandxdgshellv6.cpp index f971fe5b4..d1ee45dab 100644 --- a/src/compositor/extensions/qwaylandxdgshellv6.cpp +++ b/src/compositor/extensions/qwaylandxdgshellv6.cpp @@ -1801,6 +1801,26 @@ uint QWaylandXdgPopupV6::sendConfigure(const QRect &geometry) return d->sendConfigure(geometry); } +/*! + * \qmlmethod void QtWaylandCompositor::XdgPopupV6::sendPopupDone() + * \since 5.14 + * + * Dismiss the popup. According to the \c xdg-shell-unstable-v6 protocol this should make the + * client destroy the popup. + */ + +/*! + * \since 5.14 + * + * Dismiss the popup. According to the \c xdg-shell-unstable-v6 protocol this should make the + * client destroy the popup. + */ +void QWaylandXdgPopupV6::sendPopupDone() +{ + Q_D(QWaylandXdgPopupV6); + d->send_popup_done(); +} + /*! * Returns the surface role for the QWaylandPopupV6. */ diff --git a/src/compositor/extensions/qwaylandxdgshellv6.h b/src/compositor/extensions/qwaylandxdgshellv6.h index b9c47c578..64c82306c 100644 --- a/src/compositor/extensions/qwaylandxdgshellv6.h +++ b/src/compositor/extensions/qwaylandxdgshellv6.h @@ -246,6 +246,7 @@ public: QPoint unconstrainedPosition() const; Q_INVOKABLE uint sendConfigure(const QRect &geometry); + Q_REVISION(14) Q_INVOKABLE void sendPopupDone(); static QWaylandSurfaceRole *role(); -- cgit v1.2.3