Commit 0c719676 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

[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
parent ac4dce1c
......@@ -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());
});
}
}
......
......@@ -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)) {
......
......@@ -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.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment