From 8092d48892d10519bddbbb7a2adbe6a5af8abf1b Mon Sep 17 00:00:00 2001 From: Cyril Marpaud Date: Tue, 21 Apr 2026 16:16:22 +0200 Subject: [PATCH] fix(battery): apply panel settings from the widget that opened it When two Battery widgets were configured simultaneously, the panelID (which controls showPowerProfiles and showNoctaliaPerformance in the panel) was being overwritten by reactive QML bindings on both widget instances whenever isPanelOpen changed. This caused one widget's settings to consistently override the other's. Move the panelID write out of getBatteryPanel() (which was called from a reactive tooltipText binding) and into toggleBatteryPanel(), guarded by !panel.isPanelOpen so it only fires when actually opening the panel. Co-Authored-By: Claude Sonnet 4.6 --- Modules/Bar/Widgets/Battery.qml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Modules/Bar/Widgets/Battery.qml b/Modules/Bar/Widgets/Battery.qml index 9e87cf8ee4..03ac2cc873 100644 --- a/Modules/Bar/Widgets/Battery.qml +++ b/Modules/Bar/Widgets/Battery.qml @@ -247,17 +247,19 @@ Item { // ==================== SHARED ==================== function getBatteryPanel() { - var panel = PanelService.getPanel("batteryPanel", screen); - if (panel) { - panel.panelID = { - showPowerProfiles: widgetSettings.showPowerProfiles !== undefined ? widgetSettings.showPowerProfiles : widgetMetadata.showPowerProfiles, - showNoctaliaPerformance: widgetSettings.showNoctaliaPerformance !== undefined ? widgetSettings.showNoctaliaPerformance : widgetMetadata.showNoctaliaPerformance - }; - } - return panel; + return PanelService.getPanel("batteryPanel", screen); } function toggleBatteryPanel() { - getBatteryPanel()?.toggle(root); + var panel = getBatteryPanel(); + if (panel) { + if (!panel.isPanelOpen) { + panel.panelID = { + showPowerProfiles: widgetSettings.showPowerProfiles !== undefined ? widgetSettings.showPowerProfiles : widgetMetadata.showPowerProfiles, + showNoctaliaPerformance: widgetSettings.showNoctaliaPerformance !== undefined ? widgetSettings.showNoctaliaPerformance : widgetMetadata.showNoctaliaPerformance + }; + } + panel.toggle(root); + } } }