netbsd: If at least one AC adapter is connected, keep its state.

This commit is contained in:
nia 2021-07-27 10:30:56 +02:00 committed by BenBE
parent 93ca5af953
commit c85aafa608
1 changed files with 1 additions and 1 deletions

View File

@ -410,7 +410,7 @@ void Platform_getBattery(double* percent, ACPresence* isOnAC) {
totalCapacity += maxCharge;
}
if (isACAdapter) {
if (isACAdapter && *isOnAC != AC_PRESENT) {
*isOnAC = isConnected ? AC_PRESENT : AC_ABSENT;
}
}