Move hints.lookup_value() out of xdg_notifications_notifications_call_notify

Or it gets executed after hints.end() which clears hints
This commit is contained in:
Ilya Fedin 2025-03-03 18:23:37 +00:00 committed by John Preston
parent e99cb9bfb8
commit b962309498

View file

@ -743,6 +743,9 @@ void Manager::Private::showNotification(
StartServiceAsync(
_proxy.get_connection(),
crl::guard(weak, [=]() mutable {
const auto hasImage = !imageKey.empty()
&& hints.lookup_value(imageKey);
const auto hasBodyMarkup = HasCapability("body-markup");
const auto callbackWrap = gi::unwrap(
@ -780,9 +783,9 @@ void Manager::Private::showNotification(
_interface.gobj_(),
AppName.data(),
0,
(imageKey.empty() || !hints.lookup_value(imageKey)
? base::IconName().toStdString()
: std::string()).c_str(),
(!hasImage
? base::IconName().toStdString()
: std::string()).c_str(),
(hasBodyMarkup || info.subtitle.isEmpty()
? info.title.toStdString()
: info.subtitle.toStdString()