Simplify EffectHandler::findWindow(uuid) implementation

With Workspace::findToplevel() code paths in findWindow() can be
unified.
This commit is contained in:
Vlad Zahorodnii 2022-04-25 15:59:39 +03:00
parent beecf8c9d4
commit c773649377

View file

@ -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;
}