diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2018-12-21 14:31:58 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2019-02-06 15:30:23 +0000 |
commit | 60d6d83ea0c43462d5f8e17aaa654ab6f625dd6e (patch) | |
tree | 643f3860052c5ee50b3f9ab53481a4f552c025c4 /tests/auto/client/shared/xdgshell.h | |
parent | 401bdecabb950001ae3294e864ed397d1b76b3f4 (diff) |
Client xdg-shell: Add test for tooltips on popupsv5.13.0-alpha1
This used to cause protocol errors.
Task-number: QTBUG-71734
Change-Id: Ic937210fc42c93f1d411fb0fb4f269de01f07b5b
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'tests/auto/client/shared/xdgshell.h')
-rw-r--r-- | tests/auto/client/shared/xdgshell.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/auto/client/shared/xdgshell.h b/tests/auto/client/shared/xdgshell.h index 1a01ea1ea..ca19c293f 100644 --- a/tests/auto/client/shared/xdgshell.h +++ b/tests/auto/client/shared/xdgshell.h @@ -51,6 +51,7 @@ public: QVector<XdgSurface *> m_xdgSurfaces; XdgToplevel *toplevel(int i = 0); XdgPopup *popup(int i = 0); + XdgPopup *m_topmostGrabbingPopup = nullptr; CoreCompositor *m_compositor = nullptr; signals: @@ -75,8 +76,13 @@ public: void send_configure(uint serial) = delete; // Use the one below instead, as it tracks state void sendConfigure(uint serial); uint sendConfigure(); + bool isTopmostGrabbingPopup() const { return m_popup && m_xdgWmBase->m_topmostGrabbingPopup == m_popup; } + bool isValidPopupGrabParent() const { return isTopmostGrabbingPopup() || (m_toplevel && !m_xdgWmBase->m_topmostGrabbingPopup); } + + // Role objects XdgToplevel *m_toplevel = nullptr; XdgPopup *m_popup = nullptr; + XdgWmBase *m_xdgWmBase = nullptr; Surface *m_surface = nullptr; bool m_configureSent = false; @@ -86,6 +92,7 @@ public: struct DoubleBufferedState { QRect windowGeometry = {0, 0, 0, 0}; } m_pending, m_committed; + QVector<XdgPopup *> m_popups; public slots: void verifyConfigured() { QVERIFY(m_configureSent); } @@ -98,7 +105,7 @@ protected: void xdg_surface_get_toplevel(Resource *resource, uint32_t id) override; void xdg_surface_get_popup(Resource *resource, uint32_t id, ::wl_resource *parent, ::wl_resource *positioner) override; void xdg_surface_destroy_resource(Resource *resource) override; - void xdg_surface_destroy(Resource *resource) override { wl_resource_destroy(resource->handle); } + void xdg_surface_destroy(Resource *resource) override; void xdg_surface_set_window_geometry(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override; void xdg_surface_ack_configure(Resource *resource, uint32_t serial) override; }; @@ -126,14 +133,17 @@ protected: class XdgPopup : public QtWaylandServer::xdg_popup { public: - explicit XdgPopup(XdgSurface *xdgSurface, int id, int version = 1); + explicit XdgPopup(XdgSurface *xdgSurface, XdgSurface *parent, int id, int version = 1); void sendConfigure(const QRect &geometry); + uint sendCompleteConfigure(const QRect &geometry); Surface *surface() { return m_xdgSurface->m_surface; } XdgSurface *m_xdgSurface = nullptr; + XdgSurface *m_parentXdgSurface = nullptr; bool m_grabbed = false; uint m_grabSerial = 0; protected: void xdg_popup_grab(Resource *resource, ::wl_resource *seat, uint32_t serial) override; + void xdg_popup_destroy(Resource *resource) override; }; } // namespace MockCompositor |