Brendan Shanks (@bshanks) commented about dlls/ntdll/unix/system.c:
+ if (!CFStringCompare( prop, CFSTR(kIOPSACPowerValue), 0 )) { bs->AcOnLine = TRUE; - if (value & kIOBatteryCharge) + if (is_charging) bs->Charging = TRUE; } else bs->Discharging = TRUE;
/* We'll need the voltage to be able to interpret the other values. */ - prop = CFDictionaryGetValue( battery, CFSTR(kIOBatteryVoltageKey) ); - CFNumberGetValue( prop, kCFNumberSInt32Type, &voltage ); + prop = CFDictionaryGetValue( source, CFSTR(kIOPSVoltageKey) ); + if (prop) + CFNumberGetValue( prop, kCFNumberSInt32Type, &voltage ); The documentation for all these keys says that the type is `kCFNumberIntType` (equivalent to SInt32, but it would be better to use the documented type)
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2283#note_25623