mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 15:36:20 -05:00
13b6254abc
* gnu/packages/patches/waybar-0.11.0-fix-tray-icons.patch: New patch. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/wm.scm (waybar)[source]: Use it. Change-Id: Ib480b815faf3a331e1fc093dee72bb3099df57c5 Signed-off-by: John Kehayias <john.kehayias@protonmail.com>
86 lines
4 KiB
Diff
86 lines
4 KiB
Diff
Taken from upstream's merged PR #3604 [1].
|
|
|
|
[1] https://github.com/Alexays/Waybar/pull/3604
|
|
|
|
From 0006e4713ae19776528038b3242ded05db884ba5 Mon Sep 17 00:00:00 2001
|
|
From: Aleksei Bavshin <alebastr89@gmail.com>
|
|
Date: Sat, 14 Sep 2024 07:37:37 -0700
|
|
Subject: [PATCH 2/2] fix(tray): revert ustring formatting changes
|
|
|
|
This reverts commit a4d31ab10d1630cb9104c695d7b777ca12468904.
|
|
---
|
|
src/modules/sni/item.cpp | 23 +++++++++--------------
|
|
1 file changed, 9 insertions(+), 14 deletions(-)
|
|
|
|
diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp
|
|
index 8afb39fb3..6c4ec8c06 100644
|
|
--- a/src/modules/sni/item.cpp
|
|
+++ b/src/modules/sni/item.cpp
|
|
@@ -104,11 +104,9 @@ void Item::proxyReady(Glib::RefPtr<Gio::AsyncResult>& result) {
|
|
this->updateImage();
|
|
|
|
} catch (const Glib::Error& err) {
|
|
- spdlog::error("Failed to create DBus Proxy for {} {}: {}", bus_name, object_path,
|
|
- std::string(err.what()));
|
|
+ spdlog::error("Failed to create DBus Proxy for {} {}: {}", bus_name, object_path, err.what());
|
|
} catch (const std::exception& err) {
|
|
- spdlog::error("Failed to create DBus Proxy for {} {}: {}", bus_name, object_path,
|
|
- std::string(err.what()));
|
|
+ spdlog::error("Failed to create DBus Proxy for {} {}: {}", bus_name, object_path, err.what());
|
|
}
|
|
}
|
|
|
|
@@ -126,15 +124,14 @@ ToolTip get_variant<ToolTip>(const Glib::VariantBase& value) {
|
|
result.text = get_variant<Glib::ustring>(container.get_child(2));
|
|
auto description = get_variant<Glib::ustring>(container.get_child(3));
|
|
if (!description.empty()) {
|
|
- result.text = fmt::format("<b>{}</b>\n{}", std::string(result.text), std::string(description));
|
|
+ result.text = fmt::format("<b>{}</b>\n{}", result.text, description);
|
|
}
|
|
return result;
|
|
}
|
|
|
|
void Item::setProperty(const Glib::ustring& name, Glib::VariantBase& value) {
|
|
try {
|
|
- spdlog::trace("Set tray item property: {}.{} = {}", id.empty() ? bus_name : id,
|
|
- std::string(name), get_variant<std::string>(value));
|
|
+ spdlog::trace("Set tray item property: {}.{} = {}", id.empty() ? bus_name : id, name, value);
|
|
|
|
if (name == "Category") {
|
|
category = get_variant<std::string>(value);
|
|
@@ -179,12 +176,10 @@ void Item::setProperty(const Glib::ustring& name, Glib::VariantBase& value) {
|
|
}
|
|
} catch (const Glib::Error& err) {
|
|
spdlog::warn("Failed to set tray item property: {}.{}, value = {}, err = {}",
|
|
- id.empty() ? bus_name : id, std::string(name), get_variant<std::string>(value),
|
|
- std::string(err.what()));
|
|
+ id.empty() ? bus_name : id, name, value, err.what());
|
|
} catch (const std::exception& err) {
|
|
spdlog::warn("Failed to set tray item property: {}.{}, value = {}, err = {}",
|
|
- id.empty() ? bus_name : id, std::string(name), get_variant<std::string>(value),
|
|
- std::string(err.what()));
|
|
+ id.empty() ? bus_name : id, name, value, err.what());
|
|
}
|
|
}
|
|
|
|
@@ -226,9 +221,9 @@ void Item::processUpdatedProperties(Glib::RefPtr<Gio::AsyncResult>& _result) {
|
|
|
|
this->updateImage();
|
|
} catch (const Glib::Error& err) {
|
|
- spdlog::warn("Failed to update properties: {}", std::string(err.what()));
|
|
+ spdlog::warn("Failed to update properties: {}", err.what());
|
|
} catch (const std::exception& err) {
|
|
- spdlog::warn("Failed to update properties: {}", std::string(err.what()));
|
|
+ spdlog::warn("Failed to update properties: {}", err.what());
|
|
}
|
|
update_pending_.clear();
|
|
}
|
|
@@ -250,7 +245,7 @@ static const std::map<std::string_view, std::set<std::string_view>> signal2props
|
|
|
|
void Item::onSignal(const Glib::ustring& sender_name, const Glib::ustring& signal_name,
|
|
const Glib::VariantContainerBase& arguments) {
|
|
- spdlog::trace("Tray item '{}' got signal {}", id, std::string(signal_name));
|
|
+ spdlog::trace("Tray item '{}' got signal {}", id, signal_name);
|
|
auto changed = signal2props.find(signal_name.raw());
|
|
if (changed != signal2props.end()) {
|
|
if (update_pending_.empty()) {
|