From 884ff781bd6eabc9f40c4f5f781e826e31dcd30c Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Wed, 20 Mar 2024 18:38:32 +0700 Subject: [PATCH] fix mpris without plasma browser integration --- .../ags/modules/indicators/musiccontrols.js | 50 +------------------ 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/.config/ags/modules/indicators/musiccontrols.js b/.config/ags/modules/indicators/musiccontrols.js index 61be3d142..7148dfc57 100644 --- a/.config/ags/modules/indicators/musiccontrols.js +++ b/.config/ags/modules/indicators/musiccontrols.js @@ -395,57 +395,9 @@ export default () => Revealer({ transitionDuration: userOptions.animations.durationLarge, revealChild: false, child: Box({ - setup: (self) => self.hook(Mpris, box => { - box.children.forEach(child => { - child.destroy(); - child = null; - }); - Mpris.players.forEach((player, i) => { - if (isRealPlayer(player)) { - const newInstance = MusicControlsWidget(player); - box.add(newInstance); - } - }); - }, 'notify::players'), + children: Mpris.bind("players").as(p => p.map(MusicControlsWidget)) }), setup: (self) => self.hook(showMusicControls, (revealer) => { revealer.revealChild = showMusicControls.value; }), }) - -// export default () => MarginRevealer({ -// transition: 'slide_down', -// revealChild: false, -// showClass: 'osd-show', -// hideClass: 'osd-hide', -// child: Box({ -// setup: (self) => self.hook(Mpris, box => { -// let foundPlayer = false; -// Mpris.players.forEach((player, i) => { -// if (isRealPlayer(player)) { -// foundPlayer = true; -// box.children.forEach(child => { -// child.destroy(); -// child = null; -// }); -// const newInstance = MusicControlsWidget(player); -// box.children = [newInstance]; -// } -// }); - -// if (!foundPlayer) { -// const children = box.get_children(); -// for (let i = 0; i < children.length; i++) { -// const child = children[i]; -// child.destroy(); -// child = null; -// } -// return; -// } -// }, 'notify::players'), -// }), -// setup: (self) => self.hook(showMusicControls, (revealer) => { -// if (showMusicControls.value) revealer.attribute.show(); -// else revealer.attribute.hide(); -// }), -// })