diff --git a/shell_client.cpp b/shell_client.cpp index 2bcb7a8f21..975ae473e0 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -101,6 +101,9 @@ ShellClient::ShellClient(ShellSurfaceInterface *surface) setResourceClass(m_shellSurface->windowClass()); } ); + + setTransient(); + connect(surface, &ShellSurfaceInterface::transientForChanged, this, &ShellClient::setTransient); } ShellClient::~ShellClient() = default; @@ -712,4 +715,15 @@ void ShellClient::updateIcon() setIcon(QIcon::fromTheme(df.readIcon())); } +bool ShellClient::isTransient() const +{ + return m_shellSurface->isTransient(); +} + +void ShellClient::setTransient() +{ + const auto s = m_shellSurface->transientFor(); + setTransientFor(waylandServer()->findClient(s.data())); +} + } diff --git a/shell_client.h b/shell_client.h index 79ab0a67e9..32f70a8c28 100644 --- a/shell_client.h +++ b/shell_client.h @@ -111,6 +111,8 @@ public: bool isInitialPositionSet() const; + bool isTransient() const override; + protected: void addDamage(const QRegion &damage) override; bool belongsToSameApplication(const AbstractClient *other, bool active_hack) const override; @@ -129,6 +131,7 @@ private: void updateInternalWindowGeometry(); void updateIcon(); void markAsMapped(); + void setTransient(); static void deleteClient(ShellClient *c); KWayland::Server::ShellSurfaceInterface *m_shellSurface;