Summary: | With power profiles not available, battery icon keeps being shown in system tray when fully charged after update to Plasma 6.2.0 | ||
---|---|---|---|
Product: | [Plasma] plasmashell | Reporter: | Daniel Hofstetter <daniel-hofstetter> |
Component: | Power and Battery widget | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | elydgolden, jpetso, kde, materka, natalie_clarius, nate |
Priority: | NOR | Keywords: | regression |
Version: | 6.2.0 | ||
Target Milestone: | 1.0 | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/powerdevil/-/commit/6430f5f9b1554e432573ae901d163f6bd7997be7 | Version Fixed In: | 6.3.0 |
Sentry Crash Report: | |||
Attachments: |
Battery icon in the system tray
Battery icon hiding as intended Battery icon showing even at full charge |
Description
Daniel Hofstetter
2024-10-11 06:15:54 UTC
Cannot reproduce. Can you attach a screenshot that shows the issue? Created attachment 174720 [details]
Battery icon in the system tray
I attached a screenshot, though there is not much to see. It's just that the (fully charged) battery icon is always shown in the system tray if the battery is fully charged and the laptop is plugged in. Previously, the battery icon was not shown in such a case.
Can confirm on Plasma 6.2.0 on openSUSE Tumbleweed 20241012. It seems to be inconsistent; sometimes the battery icon hides itself normally other times it shows up, even at 100% full charge. This is all while being set to "shown when relevant" in the system tray. Can't figure out quite yet how to consistently reproduce it Created attachment 174826 [details]
Battery icon hiding as intended
Created attachment 174827 [details]
Battery icon showing even at full charge
Some more info: I just realized that KDE isn't recognizing my power profiles in this state, which is odd given that I do have power-profiles-daemon installed... Even more info: I can reproduce the bug by forcing a shutdown when plugged in at full charge. Power profiles don't seem to work until I do a proper shut down and then boot back up on battery power Ok, so when the power profiles subsystem is not available, that's when it happens? Daniel, can you reproduce that too? Yes, after installing power-profiles-daemon it works on my machine. Thanks to @elydgolden! No problem! I guess then the fact that power-profiles-daemon isn't getting activated on my machine is a separate issue? Yes, it looks like it's a separate issue. Yes, but the icon hiding when expected definitely shouldn't be dependent on power-profiles-daemon being activated. I'll take a look. Ahh I see the problem: Plasmoid.status: { if (inhibitionControl.isManuallyInhibited || !powerProfilesControl.isInDefaultPowerProfile) { return PlasmaCore.Types.ActiveStatus; } We're not checking for whether power profiles are actually installed and available. When they're not, all the properties for them are false, and inverting the false becomes true, and boom, the applet becomes active. Natalie, could you take a look here? Git commit 6430f5f9b1554e432573ae901d163f6bd7997be7 by Jakob Petsovits, on behalf of Marko Zajc. Committed on 01/01/2025 at 00:12. Pushed by jpetso into branch 'master'. applets/batterymonitor: Assume default power profile is used if power profile is unset Before this patch, `isInDefaultPowerProfile` was set to `false` when power-profiles-daemon is not installed. This causes the batterymonitor system tray entry to remain stuck in the active state, which is rather annoying. This happened because `defaultPowerProfile`, which is always set to a non-empty string, and `activeProfile`, which is blank when the p-p-d is missing, are not equal. This patch sets `isInDefaultPowerProfile` to `true` when `activeProfile` is unset. On a system without p-p-d installed, this fixes the behaviour of the batterymonitor widget and correctly puts it into passive state. On a system with p-p-d installed, this does not alter behaviour, because it only triggers when `activeProfile` is blank. M +1 -1 applets/batterymonitor/package/contents/ui/main.qml https://invent.kde.org/plasma/powerdevil/-/commit/6430f5f9b1554e432573ae901d163f6bd7997be7 |