summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2020-11-10 19:06:48 +0100
committerDavid Redondo <qt@david-redondo.de>2021-12-09 10:33:08 +0100
commitbd6dbf01f13007c20f93080d59b26d3635a81a9d (patch)
treeb44c2917c626ec3192e028c843413c354df7d11f /src/client
parent283a2d61d03315495a52d82f356e7cb5292f4bb4 (diff)
downloadqtwayland-bd6dbf01f13007c20f93080d59b26d3635a81a9d.tar.gz
Implement xdg_activation_v1 protocol
Change-Id: Ib5c8d0c6a209308c2c1a7f5e45d8866ba0127d81 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/client')
-rw-r--r--src/client/qwaylandshellsurface.cpp11
-rw-r--r--src/client/qwaylandshellsurface_p.h2
-rw-r--r--src/client/qwaylandwindow.cpp13
-rw-r--r--src/client/qwaylandwindow_p.h4
4 files changed, 28 insertions, 2 deletions
diff --git a/src/client/qwaylandshellsurface.cpp b/src/client/qwaylandshellsurface.cpp
index 81e05a44..f87e5962 100644
--- a/src/client/qwaylandshellsurface.cpp
+++ b/src/client/qwaylandshellsurface.cpp
@@ -105,6 +105,17 @@ uint32_t QWaylandShellSurface::getSerial(QWaylandInputDevice *inputDevice)
return inputDevice->serial();
}
+void QWaylandShellSurface::setXdgActivationToken(const QString &token)
+{
+ Q_UNUSED(token);
+ qCWarning(lcQpaWayland) << "setXdgActivationToken not implemented" << token;
+}
+
+void QWaylandShellSurface::requestXdgActivationToken(quint32 serial)
+{
+ Q_UNUSED(serial);
+ Q_EMIT m_window->xdgActivationTokenCreated({});
+}
}
QT_END_NAMESPACE
diff --git a/src/client/qwaylandshellsurface_p.h b/src/client/qwaylandshellsurface_p.h
index cdf1abdb..4779eebb 100644
--- a/src/client/qwaylandshellsurface_p.h
+++ b/src/client/qwaylandshellsurface_p.h
@@ -103,6 +103,8 @@ public:
virtual void setWindowPosition(const QPoint &position) { Q_UNUSED(position); }
virtual bool requestActivate() { return false; }
+ virtual void setXdgActivationToken(const QString &token);
+ virtual void requestXdgActivationToken(quint32 serial);
inline QWaylandWindow *window() { return m_window; }
QPlatformWindow *platformWindow();
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index b0d1c0d1..3481a8fa 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -1249,8 +1249,8 @@ void QWaylandWindow::restoreMouseCursor(QWaylandInputDevice *device)
void QWaylandWindow::requestActivateWindow()
{
- if (mShellSurface == nullptr || !mShellSurface->requestActivate())
- qCWarning(lcQpaWayland) << "Wayland does not support QWindow::requestActivate()";
+ if (mShellSurface)
+ mShellSurface->requestActivate();
}
bool QWaylandWindow::isExposed() const
@@ -1497,6 +1497,15 @@ void QWaylandWindow::setOpaqueArea(const QRegion &opaqueArea)
wl_region_destroy(region);
}
+void QWaylandWindow::requestXdgActivationToken(uint serial)
+{
+ mShellSurface->requestXdgActivationToken(serial);
+}
+
+void QWaylandWindow::setXdgActivationToken(const QString &token)
+{
+ mShellSurface->setXdgActivationToken(token);
+}
}
QT_END_NAMESPACE
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index f2dbe337..4eecdd86 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -230,12 +230,16 @@ public:
void handleUpdate();
void deliverUpdateRequest() override;
+ void setXdgActivationToken(const QString &token);
+ void requestXdgActivationToken(uint serial);
+
public slots:
void applyConfigure();
signals:
void wlSurfaceCreated();
void wlSurfaceDestroyed();
+ void xdgActivationTokenCreated(const QString &token);
protected:
virtual void doHandleFrameCallback();