diff options
author | Jørgen Lind <jorgen.lind@theqtcompany.com> | 2015-09-14 16:24:30 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-09-16 10:35:14 +0000 |
commit | dae5d55dea859bb3a5722bf665d077f1f9b3d360 (patch) | |
tree | d08e0906b015add456105a1bc261fdcfba2f8701 /src/compositor/extensions/qwaylandshell.cpp | |
parent | e9aa3a9edf63ff0f47f38e73ef20403f7bec1a0d (diff) |
Implement resize/move for pure-qml
Change-Id: I7919f7715486fa2d8cfe35c08095f6c33757a515
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Diffstat (limited to 'src/compositor/extensions/qwaylandshell.cpp')
-rw-r--r-- | src/compositor/extensions/qwaylandshell.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/compositor/extensions/qwaylandshell.cpp b/src/compositor/extensions/qwaylandshell.cpp index cb8ccf778..8b724bb3e 100644 --- a/src/compositor/extensions/qwaylandshell.cpp +++ b/src/compositor/extensions/qwaylandshell.cpp @@ -267,6 +267,7 @@ void QWaylandShellSurface::initialize(QWaylandShell *shell, QWaylandSurface *sur d->m_surface = surface; d->init(client->client(), id, 1); setExtensionContainer(surface); + emit surfaceChanged(); QWaylandExtension::initialize(); } void QWaylandShellSurface::initialize() @@ -284,6 +285,35 @@ QByteArray QWaylandShellSurface::interfaceName() return QWaylandShellSurfacePrivate::interfaceName(); } +QSize QWaylandShellSurface::sizeForResize(const QSizeF &size, const QPointF &delta, QWaylandShellSurface::ResizeEdge edge) +{ + qreal width = size.width(); + qreal height = size.height(); + if (edge & LeftEdge) + width -= delta.x(); + else if (edge & RightEdge) + width += delta.x(); + + if (edge & TopEdge) + height -= delta.y(); + else if (edge & BottomEdge) + height += delta.y(); + + return QSizeF(width, height).toSize(); +} + +void QWaylandShellSurface::sendConfigure(const QSize &size, ResizeEdge edges) +{ + Q_D(QWaylandShellSurface); + d->send_configure(edges, size.width(), size.height()); +} + +void QWaylandShellSurface::sendPopupDone() +{ + Q_D(QWaylandShellSurface); + d->send_popup_done(); +} + QWaylandSurface *QWaylandShellSurface::surface() const { Q_D(const QWaylandShellSurface); |