From b86edfc213fdf29ac72b0fde6cb41284e07ff51a Mon Sep 17 00:00:00 2001 From: tr1x_em Date: Wed, 6 Aug 2025 12:14:06 +0530 Subject: [PATCH] fix: Replace append method with children property for music widget management --- modules/controlcenter/main.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/controlcenter/main.py b/modules/controlcenter/main.py index bc39924..77dc454 100644 --- a/modules/controlcenter/main.py +++ b/modules/controlcenter/main.py @@ -309,7 +309,11 @@ class ModusControlCenter(Window): """Clean up resources when widget is hidden""" # Clean up music widget content if it exists if self._music_widget_content and not self._music_initialized: - self.music_widget.remove(self._music_widget_content) + # Remove from the parent container + current_children = list(self.music_widget.children) + if self._music_widget_content in current_children: + current_children.remove(self._music_widget_content) + self.music_widget.children = current_children self._music_widget_content = None # Reset lazy loading flags to allow re-initialization when shown again @@ -319,7 +323,10 @@ class ModusControlCenter(Window): """Lazy load music widget content""" if not self._music_initialized: self._music_widget_content = PlayerBoxStack(MprisPlayerManager(), control_center=self) - self.music_widget.append(self._music_widget_content) + # Add to the music widget's children list + current_children = list(self.music_widget.children) + current_children.append(self._music_widget_content) + self.music_widget.children = current_children self._music_initialized = True def _ensure_bluetooth_widgets(self):