summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wayland/qwaylandshellsurface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/wayland/qwaylandshellsurface.cpp')
-rw-r--r--src/plugins/platforms/wayland/qwaylandshellsurface.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/plugins/platforms/wayland/qwaylandshellsurface.cpp b/src/plugins/platforms/wayland/qwaylandshellsurface.cpp
index de0101f9b..8403341e3 100644
--- a/src/plugins/platforms/wayland/qwaylandshellsurface.cpp
+++ b/src/plugins/platforms/wayland/qwaylandshellsurface.cpp
@@ -51,6 +51,7 @@
QWaylandShellSurface::QWaylandShellSurface(struct wl_shell_surface *shell_surface, QWaylandWindow *window)
: m_shell_surface(shell_surface)
, m_window(window)
+ , m_maximized(false)
{
wl_shell_surface_add_listener(m_shell_surface,&m_shell_surface_listener,this);
}
@@ -74,6 +75,24 @@ void QWaylandShellSurface::move(QWaylandInputDevice *inputDevice)
QWaylandDisplay::currentTimeMillisec());
}
+void QWaylandShellSurface::toggleMaximize()
+{
+ if (m_maximized) {
+ setTopLevel();
+ m_window->configure(0, m_size.width(), m_size.height());
+ } else {
+ m_size = m_window->window()->frameGeometry().size();
+ wl_shell_surface_set_maximized(m_shell_surface, 0);
+ }
+
+ m_maximized = !m_maximized;
+}
+
+void QWaylandShellSurface::minimize()
+{
+ // TODO: There's no wl_shell_surface API for this
+}
+
void QWaylandShellSurface::setTopLevel()
{
wl_shell_surface_set_toplevel(m_shell_surface);