Bug 505763

Summary: Brightness in KScreen KCM may not quite match the value shown in the Brightness and Color widget
Product: [Applications] systemsettings Reporter: madness742
Component: kcm_kscreenAssignee: kscreen-bugs-null <kscreen-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: nate, plasma-bugs, xaver.hugl
Priority: NOR    
Version First Reported In: 6.4.0   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In: 6.4.2
Sentry Crash Report:
Attachments: Showcase of the brightness mismatch.
Showcase of the manually entering value bug.

Description madness742 2025-06-19 07:40:26 UTC
Created attachment 182377 [details]
Showcase of the brightness mismatch.

SUMMARY
When trying to set the monitor brightness to 57% (Without DDC/CI), it changes it to 56% after applying the change.

STEPS TO REPRODUCE
1. Under System Settings -> Display Configuration, disable "Control hardware brightness with DDC/CI".
2. Set brightness to 57% in either system settings, or by using the Brightness & Colour Applet.

OBSERVED RESULT
The brightness under System Settings -> Display Configuration will be set to 56%, but the Brightness & Colour Applet shows 57%.

EXPECTED RESULT
It should display 57% under System Settings -> Display Configuration.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Linux 42
KDE Plasma Version: 6.4.0
KDE Frameworks Version: 6.15.0
Qt Version: 6.9.1

ADDITIONAL INFORMATION
- Entering a value manually under System Settings -> Display Configuration -> Brightness is also buggy. It either doesn't work sometimes, or it switches up the "%" symbol around.
Comment 1 madness742 2025-06-19 07:44:39 UTC
Created attachment 182378 [details]
Showcase of the manually entering value bug.

The percentage symbol gets swapped around, and there doesn't seem to be a character limit.
Comment 2 Nate Graham 2025-06-19 19:45:43 UTC
I can reproduce this mismatch. Probably the two calculations round off the returned value in slightly different ways.
Comment 3 Bug Janitor Service 2025-06-26 12:22:04 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kscreen/-/merge_requests/407
Comment 4 Zamundaaa 2025-06-26 12:39:09 UTC
Git commit 414a6c7877cdcc3f26e679fedf98b43ea572613b by Xaver Hugl.
Committed on 26/06/2025 at 12:20.
Pushed by zamundaaa into branch 'master'.

kcm: round brightness value

Otherwise, slight floating point differences can change the value

M  +2    -2    kcm/ui/OutputPanel.qml

https://invent.kde.org/plasma/kscreen/-/commit/414a6c7877cdcc3f26e679fedf98b43ea572613b
Comment 5 Zamundaaa 2025-06-26 15:59:29 UTC
Git commit 0a9f419957252c93e9f7a73622086ad9441e1b57 by Xaver Hugl, on behalf of Xaver Hugl.
Committed on 26/06/2025 at 15:56.
Pushed by zamundaaa into branch 'Plasma/6.4'.

kcm: round brightness value

Otherwise, slight floating point differences can change the value


(cherry picked from commit 414a6c7877cdcc3f26e679fedf98b43ea572613b)

Co-authored-by: Xaver Hugl <xaver.hugl@kde.org>

M  +2    -2    kcm/ui/OutputPanel.qml

https://invent.kde.org/plasma/kscreen/-/commit/0a9f419957252c93e9f7a73622086ad9441e1b57
Comment 6 Zamundaaa 2025-06-26 15:59:42 UTC
Git commit ecc9f70d857fcbc651a090905b54731855172049 by Xaver Hugl, on behalf of Xaver Hugl.
Committed on 26/06/2025 at 15:57.
Pushed by zamundaaa into branch 'Plasma/6.3'.

kcm: round brightness value

Otherwise, slight floating point differences can change the value


(cherry picked from commit 414a6c7877cdcc3f26e679fedf98b43ea572613b)

Co-authored-by: Xaver Hugl <xaver.hugl@kde.org>

M  +2    -2    kcm/ui/OutputPanel.qml

https://invent.kde.org/plasma/kscreen/-/commit/ecc9f70d857fcbc651a090905b54731855172049