public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/powerdevil] f45: Avoid low battery alerts for unknown percentages
@ 2026-10-04  1:20 Steve Cossette
  0 siblings, 0 replies; only message in thread
From: Steve Cossette @ 2026-10-04  1:20 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/powerdevil
Branch : f45
Commit : 5d98b6acf191b275db500095b9b32dc0ba3f5f63
Author : Steve Cossette <steve@ninjasinpajamas.ca>
Date   : 2026-10-03T21:20:46-04:00
Stats  : +38/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/powerdevil/c/5d98b6acf191b275db500095b9b32dc0ba3f5f63?branch=f45

Log:
Avoid low battery alerts for unknown percentages

---
diff --git a/677.patch b/677.patch
new file mode 100644
index 0000000..6c4e5ac
--- /dev/null
+++ b/677.patch
@@ -0,0 +1,32 @@
+From 54f8a4a848fa02d06fefc5543f35224eef73670c Mon Sep 17 00:00:00 2001
+From: Matthias Kurz <m.kurz@irregular.at>
+Date: Wed, 19 Aug 2026 17:51:12 +0200
+Subject: [PATCH] Avoid low battery alerts for unknown percentages
+
+Peripheral batteries with an unavailable charge return a negative percentage. Exclude all non-positive values from low-battery notification handling so an unknown device cannot be mistaken for an empty one.
+
+(cherry picked from commit 78e99fd944a0da0d82b46d02251a8631f005f5ba)
+---
+ daemon/powerdevilcore.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/daemon/powerdevilcore.cpp b/daemon/powerdevilcore.cpp
+index 50d936c20..fabcc671d 100644
+--- a/daemon/powerdevilcore.cpp
++++ b/daemon/powerdevilcore.cpp
+@@ -521,9 +521,9 @@ bool Core::emitBatteryChargePercentNotification(int currentPercent, int previous
+             return false;
+         }
+ 
+-        // if you leave the device out of reach or it has not been initialized yet
+-        // it won't be "there" and report 0%, don't show anything in this case
+-        if (!b->isPresent() || b->chargePercent() == 0) {
++        // If you leave the device out of reach or it has not been initialized yet,
++        // it won't be "there" and can report an empty or unknown percentage.
++        if (!b->isPresent() || b->chargePercent() <= 0) {
+             return false;
+         }
+ 
+-- 
+GitLab
+

diff --git a/powerdevil.spec b/powerdevil.spec
index 5b833c2..9628ca2 100644
--- a/powerdevil.spec
+++ b/powerdevil.spec
@@ -1,6 +1,6 @@
 Name:    powerdevil
 Version: 6.7.5
-Release: 2%{?dist}
+Release: 3%{?dist}
 Summary: Manages the power consumption settings of a Plasma Shell
 
 License: BSD-3-Clause AND CC0-1.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND LGPL-2.0-only AND LGPL-2.1-only AND LGPL-2.1-or-later AND LGPL-3.0-only AND (GPL-2.0-only OR GPL-3.0-only) AND (LGPL-2.1-only OR LGPL-3.0-only)
@@ -9,6 +9,8 @@ URL:     https://invent.kde.org/plasma/%{name}
 Source0: https://download.kde.org/%{stable_kf6}/plasma/%{version}/%{name}-%{version}.tar.xz
 Source1: https://download.kde.org/%{stable_kf6}/plasma/%{version}/%{name}-%{version}.tar.xz.sig
 
+Patch0:         677.patch
+
 # Plasma Dependencies
 BuildRequires:  plasma-workspace-devel
 
@@ -143,6 +145,9 @@ rm -fv %{buildroot}/%{_libdir}/libpowerdevil{configcommonprivate,core,ui}.so
 
 
 %changelog
+* Sun Oct 04 2026 Steve Cossette <farchord@gmail.com> - 6.7.5-3
+- Added fix for battery meter bug
+
 * Wed Sep 09 2026 Steve Cossette <farchord@gmail.com> - 6.7.5-2
 - Rebuild for Qt Update
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-04  1:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-04  1:20 [rpms/powerdevil] f45: Avoid low battery alerts for unknown percentages Steve Cossette

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox