Implement transientFor in ShellClient

icc-effect-5.14.5
Martin Gräßlin 2015-09-11 12:11:01 +02:00
parent c4c3dfc73f
commit 0935a60b38
2 changed files with 17 additions and 0 deletions

View File

@ -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()));
}
}

View File

@ -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;