summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-02-06 13:36:03 +0100
committerJohan Helsing <johan.helsing@qt.io>2018-03-05 12:26:08 +0000
commit23f8d1209399d0c1cab46362143fa7bf1dd69182 (patch)
tree2dea1c188262b71cccab72f0bf5e2482d529520f /src/client
parent2c01e52f098c5a1cd7bb653b3e49fd2e02f11a60 (diff)
Client: Implement QPlatformWindow::startSystemMove()
Hooks into what we already use for the window decorations. Task-number: QTBUG-58044 Change-Id: Idcd971f69d52a5bb760bb6bffb26e9f5bdd429df Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/client')
-rw-r--r--src/client/qwaylandshellsurface_p.h2
-rw-r--r--src/client/qwaylandwindow.cpp8
-rw-r--r--src/client/qwaylandwindow_p.h2
-rw-r--r--src/client/qwaylandwlshellsurface.cpp3
-rw-r--r--src/client/qwaylandwlshellsurface_p.h2
-rw-r--r--src/client/qwaylandxdgshellv6.cpp9
-rw-r--r--src/client/qwaylandxdgshellv6_p.h2
-rw-r--r--src/client/qwaylandxdgsurface.cpp3
-rw-r--r--src/client/qwaylandxdgsurface_p.h2
9 files changed, 24 insertions, 9 deletions
diff --git a/src/client/qwaylandshellsurface_p.h b/src/client/qwaylandshellsurface_p.h
index 72bef9183..fdc309a63 100644
--- a/src/client/qwaylandshellsurface_p.h
+++ b/src/client/qwaylandshellsurface_p.h
@@ -78,7 +78,7 @@ public:
virtual void resize(QWaylandInputDevice * /*inputDevice*/, enum wl_shell_surface_resize /*edges*/)
{}
- virtual void move(QWaylandInputDevice * /*inputDevice*/) {}
+ virtual bool move(QWaylandInputDevice *) { return false; }
virtual void setTitle(const QString & /*title*/) {}
virtual void setAppId(const QString & /*appId*/) {}
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 52461dc38..ecab8ffcc 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -1045,6 +1045,14 @@ void QWaylandWindow::addAttachOffset(const QPoint point)
mOffset += point;
}
+bool QtWaylandClient::QWaylandWindow::startSystemMove(const QPoint &pos)
+{
+ Q_UNUSED(pos);
+ if (auto seat = display()->lastInputDevice())
+ return mShellSurface && mShellSurface->move(seat);
+ return false;
+}
+
}
QT_END_NAMESPACE
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index 0680b14e5..3324bf700 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -201,6 +201,8 @@ public:
void propagateSizeHints() override { }
void addAttachOffset(const QPoint point);
+ bool startSystemMove(const QPoint &pos) override;
+
void requestUpdate() override;
public slots:
diff --git a/src/client/qwaylandwlshellsurface.cpp b/src/client/qwaylandwlshellsurface.cpp
index 00b070f3f..f1b0bd2c3 100644
--- a/src/client/qwaylandwlshellsurface.cpp
+++ b/src/client/qwaylandwlshellsurface.cpp
@@ -74,10 +74,11 @@ void QWaylandWlShellSurface::resize(QWaylandInputDevice *inputDevice, enum wl_sh
edges);
}
-void QWaylandWlShellSurface::move(QWaylandInputDevice *inputDevice)
+bool QWaylandWlShellSurface::move(QWaylandInputDevice *inputDevice)
{
move(inputDevice->wl_seat(),
inputDevice->serial());
+ return true;
}
void QWaylandWlShellSurface::setTitle(const QString & title)
diff --git a/src/client/qwaylandwlshellsurface_p.h b/src/client/qwaylandwlshellsurface_p.h
index f9ac1bb4c..497ec6043 100644
--- a/src/client/qwaylandwlshellsurface_p.h
+++ b/src/client/qwaylandwlshellsurface_p.h
@@ -81,7 +81,7 @@ public:
void resize(QWaylandInputDevice *inputDevice, enum wl_shell_surface_resize edges) override;
using QtWayland::wl_shell_surface::move;
- void move(QWaylandInputDevice *inputDevice) override;
+ bool move(QWaylandInputDevice *inputDevice) override;
void setTitle(const QString & title) override;
void setAppId(const QString &appId) override;
diff --git a/src/client/qwaylandxdgshellv6.cpp b/src/client/qwaylandxdgshellv6.cpp
index 69bbf55b8..c89c8316f 100644
--- a/src/client/qwaylandxdgshellv6.cpp
+++ b/src/client/qwaylandxdgshellv6.cpp
@@ -142,10 +142,13 @@ void QWaylandXdgSurfaceV6::resize(QWaylandInputDevice *inputDevice, enum wl_shel
}
-void QWaylandXdgSurfaceV6::move(QWaylandInputDevice *inputDevice)
+bool QWaylandXdgSurfaceV6::move(QWaylandInputDevice *inputDevice)
{
- Q_ASSERT(m_toplevel && m_toplevel->isInitialized());
- m_toplevel->move(inputDevice->wl_seat(), inputDevice->serial());
+ if (m_toplevel && m_toplevel->isInitialized()) {
+ m_toplevel->move(inputDevice->wl_seat(), inputDevice->serial());
+ return true;
+ }
+ return false;
}
void QWaylandXdgSurfaceV6::setTitle(const QString &title)
diff --git a/src/client/qwaylandxdgshellv6_p.h b/src/client/qwaylandxdgshellv6_p.h
index baaf38074..b72d3d18a 100644
--- a/src/client/qwaylandxdgshellv6_p.h
+++ b/src/client/qwaylandxdgshellv6_p.h
@@ -79,7 +79,7 @@ public:
void resize(QWaylandInputDevice *inputDevice, enum zxdg_toplevel_v6_resize_edge edges);
void resize(QWaylandInputDevice *inputDevice, enum wl_shell_surface_resize edges) override;
- void move(QWaylandInputDevice *inputDevice) override;
+ bool move(QWaylandInputDevice *inputDevice) override;
void setTitle(const QString &title) override;
void setAppId(const QString &appId) override;
diff --git a/src/client/qwaylandxdgsurface.cpp b/src/client/qwaylandxdgsurface.cpp
index 40ed9f07a..4dfc5e6da 100644
--- a/src/client/qwaylandxdgsurface.cpp
+++ b/src/client/qwaylandxdgsurface.cpp
@@ -85,10 +85,11 @@ void QWaylandXdgSurface::resize(QWaylandInputDevice *inputDevice, enum resize_ed
edges);
}
-void QWaylandXdgSurface::move(QWaylandInputDevice *inputDevice)
+bool QWaylandXdgSurface::move(QWaylandInputDevice *inputDevice)
{
move(inputDevice->wl_seat(),
inputDevice->serial());
+ return true;
}
void QWaylandXdgSurface::setMaximized()
diff --git a/src/client/qwaylandxdgsurface_p.h b/src/client/qwaylandxdgsurface_p.h
index 9fcecca7c..b8dd93f47 100644
--- a/src/client/qwaylandxdgsurface_p.h
+++ b/src/client/qwaylandxdgsurface_p.h
@@ -85,7 +85,7 @@ public:
void resize(QWaylandInputDevice *inputDevice, enum wl_shell_surface_resize edges) override;
using QtWayland::xdg_surface::move;
- void move(QWaylandInputDevice *inputDevice) override;
+ bool move(QWaylandInputDevice *inputDevice) override;
void setTitle(const QString &title) override;
void setAppId(const QString &appId) override;