Bug 505071 - The battery charge limit settings spin box works incorrectly (data validated before data entry complete)
Summary: The battery charge limit settings spin box works incorrectly (data validated ...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_powerdevilprofilesconfig (other bugs)
Version First Reported In: 6.3.5
Platform: Fedora RPMs Linux
: HI normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: usability
: 511915 521311 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-05-31 18:43 UTC by Lech
Modified: 2026-09-04 01:16 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.8.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lech 2025-05-31 18:43:13 UTC
SUMMARY

Deleting "100%" in the spin entry text box and entering anything, or backspacing on 2 characters of "100%" causes it to fill up with "50%", while it should just fill up with the value I enter or allow me to backspace everything. Then, editing the "50%" is normal.

STEPS TO REPRODUCE
1. Open the Power and Battery widget
2. Click on "Configure Power Management" icon
3. Click on "Advanced Power Settings"
4. Change (or try to change) the "Charge Limit" in the spinbox, by backspacing, or deleting the whole and entering a new value

OBSERVED RESULT
"50%" appears

EXPECTED RESULT
Only what I enter appears

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 42
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Comment 1 cwo 2025-06-01 07:32:37 UTC
Can reproduce. This is not optimal, and likely caused by the spinbox being to aggressive about ensuring a valid value.
Comment 2 Nate Graham 2025-06-03 22:41:06 UTC
Yep.
Comment 3 Nate Graham 2026-06-19 14:08:52 UTC
*** Bug 511915 has been marked as a duplicate of this bug. ***
Comment 4 Nate Graham 2026-06-19 14:08:55 UTC
*** Bug 521311 has been marked as a duplicate of this bug. ***
Comment 5 Bug Janitor Service 2026-08-29 10:42:14 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/671
Comment 6 Jakob Petsovits 2026-09-03 14:18:06 UTC
Git commit 5aa89e5cdd3260cddf1acc0e62cd00cd1027d2ba by Jakob Petsovits, on behalf of Christoph Wolk.
Committed on 03/09/2026 at 14:13.
Pushed by jpetso into branch 'master'.

kcm/ui: improve charge threshold spinboxes on desktop-style

The spinboxes for charge state interact very awkwardy with
qqc2-desktop-style's automatic update behavior, in particular for
charge stop. It updates mid-edit as long as the input is valid, which
interrupts the user by re-adding the % character prematurely, and
even applies the range constraints, so trying to delete the existing
number will replace it with "50%" first. This is ultimately a
case of bad behavior in qqc2-desktop-style and does not affect union,
but we can work around it locally.

Instead, we manually recreate the QQC2 SpinBox behavior of only updating
on focus loss (which happens mostly automatically) and when manually
pressing Return.

This issue only affects qqc2-desktop-style, and we can drop this commit
if we ever decide to stop caring about the kcm's compatibility with it
(or desktop-style stops doing this, which might be difficult as external
apps may rely on this behavior).

M  +53   -7    kcm/ui/GlobalConfig.qml

https://invent.kde.org/plasma/powerdevil/-/commit/5aa89e5cdd3260cddf1acc0e62cd00cd1027d2ba