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

Huw Davies (@huw) wine at gitlab.winehq.org
Wed Jun 15 02:03:43 CDT 2022


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 battery is encountered.  Also, `bs->BatteryPresent` could be used instead of the `found_battery` variable.

-- 
https://gitlab.winehq.org/wine/wine/-/merge_requests/134#note_2077



More information about the wine-devel mailing list