diff options
author | Robert Griebl <robert.griebl@pelagicore.com> | 2019-05-21 16:22:45 +0200 |
---|---|---|
committer | Robert Griebl <robert.griebl@pelagicore.com> | 2019-05-27 13:26:29 +0200 |
commit | 8bc64e234c7a7cfef5b14d98a9859c0d33846a24 (patch) | |
tree | d5b5117698eec9889201873b489859548f65f57c /src/window-lib/waylandcompositor.h | |
parent | ac4fd5106456aab8a88263aab366ab10d148985a (diff) | |
download | qtapplicationmanager-8bc64e234c7a7cfef5b14d98a9859c0d33846a24.tar.gz |
Add support for native popups, namely Wayland XDG popups
When using the Wayland XDG shell extension, you have to explicitly handle
popups if you want to support them. Although Neptune doesn't use them,
QtWebEngine will create popups (e.g. combo boxes).
In order to be able to close these popups again from the server side, we
need to link against QtWaylandCompositor-private (for Qt < 5.14), because
the low-level Wayland API was not forwarded to the public Qt API until
Qt 5.14.
Change-Id: I9a9d23e1024929765c266c170b4043c77c115b76
Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
Diffstat (limited to 'src/window-lib/waylandcompositor.h')
-rw-r--r-- | src/window-lib/waylandcompositor.h | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/window-lib/waylandcompositor.h b/src/window-lib/waylandcompositor.h index 968457c2..283db83a 100644 --- a/src/window-lib/waylandcompositor.h +++ b/src/window-lib/waylandcompositor.h @@ -60,16 +60,21 @@ QT_FORWARD_DECLARE_CLASS(QWaylandWlShellSurface) QT_FORWARD_DECLARE_CLASS(QWaylandTextInputManager) #if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) - QT_FORWARD_DECLARE_CLASS(QWaylandXdgShell) - QT_FORWARD_DECLARE_CLASS(QWaylandXdgSurface) - QT_FORWARD_DECLARE_CLASS(QWaylandXdgToplevel) - typedef QWaylandXdgShell WaylandXdgShell; - typedef QWaylandXdgSurface WaylandXdgSurface; + +QT_FORWARD_DECLARE_CLASS(QWaylandXdgShell) +QT_FORWARD_DECLARE_CLASS(QWaylandXdgSurface) +QT_FORWARD_DECLARE_CLASS(QWaylandXdgToplevel) +QT_FORWARD_DECLARE_CLASS(QWaylandXdgPopup) +typedef QWaylandXdgShell WaylandXdgShell; +typedef QWaylandXdgSurface WaylandXdgSurface; + #else - QT_FORWARD_DECLARE_CLASS(QWaylandXdgShellV5) - QT_FORWARD_DECLARE_CLASS(QWaylandXdgSurfaceV5) - typedef QWaylandXdgShellV5 WaylandXdgShell; - typedef QWaylandXdgSurfaceV5 WaylandXdgSurface; + +QT_FORWARD_DECLARE_CLASS(QWaylandXdgShellV5) +QT_FORWARD_DECLARE_CLASS(QWaylandXdgSurfaceV5) +typedef QWaylandXdgShellV5 WaylandXdgShell; +typedef QWaylandXdgSurfaceV5 WaylandXdgSurface; + #endif QT_BEGIN_NAMESPACE_AM @@ -99,6 +104,8 @@ public: QWaylandWlShellSurface *shellSurface() const; WaylandCompositor *compositor() const; + bool isPopup() const; + QRect popupGeometry() const; void sendResizing(const QSize &size); private: @@ -114,6 +121,7 @@ public: signals: void pong(); + void popupGeometryChanged(); private: QWaylandSurface *m_surface; @@ -123,6 +131,7 @@ private: WaylandXdgSurface *m_xdgSurface = nullptr; #if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) QWaylandXdgToplevel *m_topLevel = nullptr; + QWaylandXdgPopup *m_popup = nullptr; #endif friend class WaylandCompositor; @@ -148,6 +157,7 @@ protected: void onXdgSurfaceCreated(WaylandXdgSurface *xdgSurface); #if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) void onTopLevelCreated(QWaylandXdgToplevel *toplevel, QWaylandXdgSurface *xdgSurface); + void onPopupCreated(QWaylandXdgPopup *popup, QWaylandXdgSurface *xdgSurface); #endif void onXdgPongReceived(uint serial); |