[scenes/opengl] Discard cached Lanczos textures for all toplevels

Summary:
Currently, the Lanczos filter doesn't discard cached textures for
internal and wayland clients.

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25616
This commit is contained in:
Vlad Zahorodnii 2019-11-29 21:12:11 +02:00
parent ac4dce1c20
commit 0c7196769d
3 changed files with 14 additions and 12 deletions

View file

@ -394,18 +394,10 @@ void LanczosFilter::timerEvent(QTimerEvent *event)
delete m_offscreenTex;
m_offscreenTarget = nullptr;
m_offscreenTex = nullptr;
foreach (X11Client *c, Workspace::self()->clientList()) {
discardCacheTexture(c->effectWindow());
}
foreach (X11Client *c, Workspace::self()->desktopList()) {
discardCacheTexture(c->effectWindow());
}
foreach (Unmanaged *u, Workspace::self()->unmanagedList()) {
discardCacheTexture(u->effectWindow());
}
foreach (Deleted *d, Workspace::self()->deletedList()) {
discardCacheTexture(d->effectWindow());
}
workspace()->forEachToplevel([this](Toplevel *toplevel) {
discardCacheTexture(toplevel->effectWindow());
});
}
}

View file

@ -1720,6 +1720,15 @@ Toplevel *Workspace::findToplevel(std::function<bool (const Toplevel*)> func) co
return nullptr;
}
void Workspace::forEachToplevel(std::function<void (Toplevel *)> func)
{
std::for_each(m_allClients.constBegin(), m_allClients.constEnd(), func);
std::for_each(desktops.constBegin(), desktops.constEnd(), func);
std::for_each(deleted.constBegin(), deleted.constEnd(), func);
std::for_each(unmanaged.constBegin(), unmanaged.constEnd(), func);
std::for_each(m_internalClients.constBegin(), m_internalClients.constEnd(), func);
}
bool Workspace::hasClient(const AbstractClient *c)
{
if (auto cc = dynamic_cast<const X11Client *>(c)) {

View file

@ -133,6 +133,7 @@ public:
Unmanaged *findUnmanaged(xcb_window_t w) const;
void forEachUnmanaged(std::function<void (Unmanaged*)> func);
Toplevel *findToplevel(std::function<bool (const Toplevel*)> func) const;
void forEachToplevel(std::function<void (Toplevel *)> func);
/**
* @brief Finds a Toplevel for the internal window @p w.
*