desktopbackgrounditem: Prefer desktop window with size matching output

Conky monitor's floating popup is of type desktop, too, and when it
gets picked over Plasma's desktop window, visual artifacts can be
observed behind e.g. the overview effect.
This commit is contained in:
Kai Uwe Broulik 2022-08-09 15:00:51 +00:00
parent 3934d1d0f2
commit 90688b11f6

View file

@ -105,13 +105,20 @@ void DesktopBackgroundItem::updateWindow()
#endif
}
Window *clientCandidate = nullptr;
const auto clients = workspace()->allClientList();
for (Window *client : clients) {
if (client->isDesktop() && client->isOnOutput(m_output) && client->isOnDesktop(desktop) && client->isOnActivity(activity)) {
setClient(client);
break;
// In the unlikely event there are multiple desktop windows (e.g. conky's floating panel is of type "desktop")
// choose the one which matches the ouptut size, if possible.
if (!clientCandidate || client->size() == m_output->geometry().size()) {
clientCandidate = client;
}
}
}
setClient(clientCandidate);
}
} // namespace KWin