From 75ac221b9d78d97c121b984ffc633c8cdbe3a92d Mon Sep 17 00:00:00 2001 From: Giulio Camuffo Date: Mon, 7 May 2018 17:40:57 -0700 Subject: [PATCH 2/3] Handle maximize/minimize/fullscreen in xdg_shell_v6 [ChangeLog][QPA plugin] Implement support for maximization, minimization and fullscreen with xdg-shell unstable v6. Task-number: QTBUG-63417 Task-number: QTBUG-63748 Change-Id: I385eb3279d91f1c38d2f5d46bc63b324f0456ca4 signed-off-by: Giulio Camuffo Signed-off-by: Madhurkiran Harikrishnan Upstream-Status: Backport --- src/client/qwaylandxdgshellv6.cpp | 22 ++++++++++++++++++++++ src/client/qwaylandxdgshellv6_p.h | 4 ++++ 2 files changed, 26 insertions(+) diff --git a/src/client/qwaylandxdgshellv6.cpp b/src/client/qwaylandxdgshellv6.cpp index 7473174..15d9520 100644 --- a/src/client/qwaylandxdgshellv6.cpp +++ b/src/client/qwaylandxdgshellv6.cpp @@ -231,7 +231,29 @@ void QWaylandXdgSurfaceV6::zxdg_surface_v6_configure(uint32_t serial) ack_configure(serial); } +void QWaylandXdgSurfaceV6::setMaximized() +{ + if (m_toplevel) + m_toplevel->set_maximized(); +} + +void QWaylandXdgSurfaceV6::setFullscreen() +{ + if (m_toplevel) + m_toplevel->set_fullscreen(nullptr); +} +void QWaylandXdgSurfaceV6::setNormal() +{ + if (m_toplevel) + m_toplevel->unset_maximized(); +} + +void QWaylandXdgSurfaceV6::setMinimized() +{ + if (m_toplevel) + m_toplevel->set_minimized(); +} QWaylandXdgShellV6::QWaylandXdgShellV6(struct ::wl_registry *registry, uint32_t id, uint32_t availableVersion) : QtWayland::zxdg_shell_v6(registry, id, qMin(availableVersion, 1u)) diff --git a/src/client/qwaylandxdgshellv6_p.h b/src/client/qwaylandxdgshellv6_p.h index 769f198..c79673f 100644 --- a/src/client/qwaylandxdgshellv6_p.h +++ b/src/client/qwaylandxdgshellv6_p.h @@ -88,6 +88,10 @@ public: protected: void zxdg_surface_v6_configure(uint32_t serial) override; + void setMaximized() override; + void setFullscreen() override; + void setNormal() override; + void setMinimized() override; private: class Toplevel: public QtWayland::zxdg_toplevel_v6 -- 2.7.4