From 09b2616b6b67b3abbc3964affe3890fd77bbb6f3 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Sat, 22 Jun 2024 19:24:18 -0700 Subject: [PATCH] status-area: Ignore `shortcut` field to fix parse error If this has the wrong type, it causes a parse error due to https://github.com/dbus2/zbus/issues/856. This fixes the status icon for Slack, and probably other applications. Not sure how this field is defined in general, but with Slack it is an `aas`. `gnome-shell-extension-appindicator` doesn't seem to use the `shortcut` field either. --- .../src/subscriptions/status_notifier_item.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cosmic-applet-status-area/src/subscriptions/status_notifier_item.rs b/cosmic-applet-status-area/src/subscriptions/status_notifier_item.rs index 703b97b4..105ec922 100644 --- a/cosmic-applet-status-area/src/subscriptions/status_notifier_item.rs +++ b/cosmic-applet-status-area/src/subscriptions/status_notifier_item.rs @@ -156,7 +156,10 @@ pub struct LayoutProps { #[zvariant(rename = "icon-name")] icon_name: Option, disposition: Option, - shortcut: Option, + // If this field has a different type, this causes the whole type to fail + // to parse, due to a zvariant bug. + // https://github.com/dbus2/zbus/issues/856 + // shortcut: Option, } impl zvariant::Type for LayoutProps { @@ -218,10 +221,6 @@ impl Layout { pub fn disposition(&self) -> Option<&str> { self.1.disposition.as_deref() } - - pub fn shortcut(&self) -> Option<&str> { - self.1.shortcut.as_deref() - } } #[zbus::proxy(interface = "com.canonical.dbusmenu")]