Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
power: Handle "unknown" power profiles from tuned-ppd
Tuned has become the new default in Fedora 41, replacing PPD. Tuned does offer the same DBus interface with tuned-ppd. However, because tuned supports much more profiles, the tuned-ppd api is slightly incompatible as it can return an "unknown" active profile. Some discussion here: redhat-performance/tuned#669. This crashes the Power panel. Instead, let's handle this by not doing anything when we get that profile. This means no radio buttons will end up getting selected, but that's better than showing an active profile that isn't really active. Note that tuned-ppd currently does not actively announce an ActiveProfile change if the change came from tuned, but it might start to in the future, so We do this by adding a new enum value, outside of the range of actual profiles, as we don't want to handle it as a real profile anywhere. This also removes the manual enum counting, there's no reason for that as enums are guaranteed to start at 0 and increment by 1. Note that tuned-ppd currently does not actively announce an ActiveProfile change if the change came from tuned, but it might start to in the future, so also reset all radio buttons if we get an unknown profile, just in case someone has the Power panel open and changes the active profile via tuned.
- Loading branch information