[PATCH v3 0/1] MR134: ntdll: Don't hard-code the battery and AC adapter names on Linux

Alex Henrie (@alexhenrie) wine at gitlab.winehq.org
Wed Jun 15 09:14:21 CDT 2022

On Wed Jun 15 14:14:20 2022 +0000, Huw Davies wrote:
> Sebastian Reichel replied: [1](https://www.winehq.org/pipermail/wine-devel/2022-June/220112.html)
> > /sys/class/power_supply/*/scope is set to 'Device' for all
> > batteries, that are not powering the main system. There can still
> > be multiple batteries; for example Thinkpads in the 2014-2018 era
> > used to have an internal and a removable battery. For a single
> > "X %/hours left" info the data from all 'System' level batteries
> > must be aggregated.
> Benjamin Berg also mentioned UPower: [2](https://www.winehq.org/pipermail/wine-devel/2022-June/220110.html)
> > > Wouldn't it make sense for Wine to use the UPower provided
> > > DisplayDevice that can be queried through DBus?
> To which Sebastian replied: 
> > UPower does the required data aggregation for the 'DisplayDevice'.
> > I don't know enough about the Wine codebase to recommend for or
> > against using UPower.
> So it looks like the patch's general idea is correct.  I would suggest
> adding a `FIXME()` if a second system battery is encountered.  Also,
> `bs->BatteryPresent` could be used instead of the `found_battery` variable.
Thanks for the feedback. I have added FIXMEs and removed the found_battery variable as you suggested.


More information about the wine-devel mailing list