From 216d88e977ef94dddfe33b01c8880bc763da2f05 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Fri, 5 Apr 2024 09:22:14 -0700 Subject: [PATCH] audio: Mpris media control fixes The panel buttons for next/previous didn't do anything since `on_press` wasn't set. Now they work. Fixed `autosize` which I had accidentally committed after using it for testing. (It would be good to figure out why the applets don't work properly with autosize when run outside of the panel, since that's handy for testing.) I noticed with VLC, skipping a track makes the media controls disappear very briefly, and sometimes the pause button didn't return. I guess `can_play` (etc.) are temporarily set to false, probably expecting the controls to be greyed out and not hidden from a panel. Anyway, monitoring for changes to these properties as well will hopefully fix the part where it could remain missing. Though I can't reproduce that consistently. --- cosmic-applet-audio/src/lib.rs | 18 +++++++++++--- cosmic-applet-audio/src/mpris_subscription.rs | 24 ++++++++++++------- cosmic-applet-audio/src/pulse.rs | 2 -- 3 files changed, 31 insertions(+), 13 deletions(-) diff --git a/cosmic-applet-audio/src/lib.rs b/cosmic-applet-audio/src/lib.rs index c8b0a1c4..8fed851f 100644 --- a/cosmic-applet-audio/src/lib.rs +++ b/cosmic-applet-audio/src/lib.rs @@ -50,7 +50,7 @@ const PLAY: &str = "media-playback-start-symbolic"; pub fn run() -> cosmic::iced::Result { localize(); - cosmic::applet::run::