diff --git a/shell_client.h b/shell_client.h --- a/shell_client.h +++ b/shell_client.h @@ -22,6 +22,7 @@ #include "abstract_client.h" #include +#include namespace KWayland { @@ -125,6 +126,7 @@ void installPlasmaShellSurface(KWayland::Server::PlasmaShellSurfaceInterface *surface); void installQtExtendedSurface(KWayland::Server::QtExtendedSurfaceInterface *surface); void installServerSideDecoration(KWayland::Server::ServerSideDecorationInterface *decoration); + void installXdgForeignUnstableInterface(KWayland::Server::XdgForeignUnstableInterface *foreign); bool isInitialPositionSet() const; @@ -208,6 +210,7 @@ QPointer m_plasmaShellSurface; QPointer m_qtExtendedSurface; KWayland::Server::ServerSideDecorationInterface *m_serverDecoration = nullptr; + QPointer m_XdgForeign = nullptr; bool m_userNoBorder = false; bool m_fullScreen = false; bool m_transient = false; diff --git a/shell_client.cpp b/shell_client.cpp --- a/shell_client.cpp +++ b/shell_client.cpp @@ -1320,6 +1320,9 @@ if (m_xdgShellPopup) { s = m_xdgShellPopup->transientFor().data(); } + if (m_XdgForeign) { + s = m_XdgForeign->transientFor(surface()); + } auto t = waylandServer()->findClient(s); if (t != transientFor()) { // remove from main client @@ -1399,6 +1402,13 @@ ); } +void ShellClient::installXdgForeignUnstableInterface(KWayland::Server::XdgForeignUnstableInterface *foreign) +{ + m_XdgForeign = foreign; + connect(m_XdgForeign, &KWayland::Server::XdgForeignUnstableInterface::transientChanged, this, &ShellClient::setTransient); + setTransient(); +} + bool ShellClient::shouldExposeToWindowManagement() { if (isInternal()) { diff --git a/wayland_server.h b/wayland_server.h --- a/wayland_server.h +++ b/wayland_server.h @@ -56,6 +56,7 @@ class OutputManagementInterface; class OutputConfigurationInterface; class XdgShellInterface; +class XdgForeignUnstableInterface; } } @@ -229,6 +230,7 @@ KWayland::Server::ClientConnection *client = nullptr; QPointer ddi; } m_xclipbaordSync; + KWayland::Server::XdgForeignUnstableInterface *m_XdgForeign = nullptr; QList m_clients; QList m_internalClients; QHash m_clientIds; diff --git a/wayland_server.cpp b/wayland_server.cpp --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -158,6 +158,7 @@ } else { connect(client, &ShellClient::windowShown, this, &WaylandServer::shellClientShown); } + client->installXdgForeignUnstableInterface(m_XdgForeign); } bool WaylandServer::init(const QByteArray &socketName, InitalizationFlags flags) @@ -301,6 +302,9 @@ m_display->createSubCompositor(m_display)->create(); + m_XdgForeign = m_display->createXdgForeignUnstableInterface(m_display); + m_XdgForeign->create(); + return true; }