From c773649377e2501a4e7dd7370cb838807a257043 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 25 Apr 2022 15:59:39 +0300 Subject: [PATCH] Simplify EffectHandler::findWindow(uuid) implementation With Workspace::findToplevel() code paths in findWindow() can be unified. --- src/effects.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/effects.cpp b/src/effects.cpp index 887d8bd88c..32ca6da4cb 100644 --- a/src/effects.cpp +++ b/src/effects.cpp @@ -1125,15 +1125,8 @@ EffectWindow *EffectsHandlerImpl::findWindow(QWindow *w) const EffectWindow *EffectsHandlerImpl::findWindow(const QUuid &id) const { - if (const auto client = workspace()->findAbstractClient([&id](const Window *c) { - return c->internalId() == id; - })) { - return client->effectWindow(); - } - if (const auto unmanaged = workspace()->findUnmanaged([&id](const Unmanaged *c) { - return c->internalId() == id; - })) { - return unmanaged->effectWindow(); + if (Window *window = workspace()->findToplevel(id)) { + return window->effectWindow(); } return nullptr; }