diff --git a/src/scripting/desktopbackgrounditem.cpp b/src/scripting/desktopbackgrounditem.cpp index eb7f390575..5245aa12f2 100644 --- a/src/scripting/desktopbackgrounditem.cpp +++ b/src/scripting/desktopbackgrounditem.cpp @@ -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