<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>487743</bug_id>
          
          <creation_ts>2024-05-29 13:50:53 +0000</creation_ts>
          <short_desc>No keyboard light control and always on by default</short_desc>
          <delta_ts>2024-11-27 20:55:59 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>Powerdevil</product>
          <component>general</component>
          <version>6.1.2</version>
          <rep_platform>Arch Linux</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>486067</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>regression</keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Iyán M. V.">me</reporter>
          <assigned_to name="Plasma Bugs List">plasma-bugs-null</assigned_to>
          <cc>bugs.kde.org</cc>
    
    <cc>jpetso</cc>
    
    <cc>kde</cc>
    
    <cc>natalie_clarius</cc>
    
    <cc>nate</cc>
    
    <cc>qydwhotmail</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2323067</commentid>
    <comment_count>0</comment_count>
    <who name="Iyán M. V.">me</who>
    <bug_when>2024-05-29 13:50:53 +0000</bug_when>
    <thetext>SUMMARY

After upgrading to Plasma 6.1 Beta there are three issues with the the keyboard light:

1. The slider is missing in the power and battery plasmoid
2. Changing the brightness level with the keyboard shortcut (Fn + Space on my laptop) does not produce the visual animation that was visible in 6.0 (as when changing the screen brightness or the volume)
3. The keyboard light is always on by default when booting the laptop or after resuming from sleep, no matter previous state.

STEPS TO REPRODUCE
1. Close lid, open lid -&gt; Issue 3
2. Open power and battery plasmoid from system tray -&gt; Issue 1
3. Use the laptop built-in keyboard shortcut to change brightness level -&gt; Issue 2

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.0.90
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1
Kernel Version: 6.9.2-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 21 × Intel® Core™ Ultra 7 155H
Memory: 31.0 GiB of RAM
Graphics Processor: Mesa Intel® Arc
Manufacturer: LENOVO
Product Name: 21KDS00600
System Version: ThinkPad X1 Carbon Gen 12</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2323088</commentid>
    <comment_count>1</comment_count>
    <who name="Iyán M. V.">me</who>
    <bug_when>2024-05-29 15:10:13 +0000</bug_when>
    <thetext>There was a typo in my report: I meant the Brightness and Color plasmoid.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2323094</commentid>
    <comment_count>2</comment_count>
    <who name="Iyán M. V.">me</who>
    <bug_when>2024-05-29 15:40:21 +0000</bug_when>
    <thetext>I did a git bisect from tags 6.0.4 to 6.0.90 and this is what I found:

fe9e90f51728c8ba16aa5597f909018e213191a8 is the first bad commit
commit fe9e90f51728c8ba16aa5597f909018e213191a8 (HEAD)
Author: Bogdan Onofriichuk &lt;bogdan.onofriuchuk@gmail.com&gt;
Date:   Tue Dec 19 12:02:56 2023 +0200

    Extract keyboard brightness into separate class.

 daemon/CMakeLists.txt                                |   9 +++++++++
 daemon/actions/bundled/dimdisplay.cpp                |   5 +++--
 daemon/actions/bundled/dpms.cpp                      |   5 ++---
 daemon/actions/bundled/handlebuttonevents.cpp        |   8 ++++----
 daemon/actions/bundled/keyboardbrightnesscontrol.cpp |  27 ++++++++++++--------------
 daemon/actions/bundled/keyboardbrightnesscontrol.h   |   2 +-
 daemon/backends/upower/CMakeLists.txt                |   5 -----
 daemon/backends/upower/powerdevilupowerbackend.cpp   | 101 +------------------------------------------------------------------------------------------------
 daemon/backends/upower/powerdevilupowerbackend.h     |  13 -------------
 daemon/controllers/keyboardbrightnesscontroller.cpp  | 149 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 daemon/controllers/keyboardbrightnesscontroller.h    |  51 +++++++++++++++++++++++++++++++++++++++++++++++++
 daemon/powerdevilaction.cpp                          |   2 +-
 daemon/powerdevilaction.h                            |   2 +-
 daemon/powerdevilbackendinterface.cpp                |  27 --------------------------
 daemon/powerdevilbackendinterface.h                  |  20 --------------------
 daemon/powerdevilcore.cpp                            |  12 ++++++++++++
 daemon/powerdevilcore.h                              |   6 ++++++
 17 files changed, 252 insertions(+), 192 deletions(-)
 create mode 100644 daemon/controllers/keyboardbrightnesscontroller.cpp
 create mode 100644 daemon/controllers/keyboardbrightnesscontroller.h</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2323351</commentid>
    <comment_count>3</comment_count>
    <who name="David Edmundson">kde</who>
    <bug_when>2024-05-30 12:17:46 +0000</bug_when>
    <thetext>Can you ensure there are no stray old files in ./plugins/powerdevil in wherever you install your software</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2323352</commentid>
    <comment_count>4</comment_count>
    <who name="David Edmundson">kde</who>
    <bug_when>2024-05-30 12:18:44 +0000</bug_when>
    <thetext>&gt;1. The slider is missing in the power and battery plasmoid

Note that this moved to a new brightness applet</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2323353</commentid>
    <comment_count>5</comment_count>
    <who name="David Edmundson">kde</who>
    <bug_when>2024-05-30 12:19:37 +0000</bug_when>
    <thetext>When you did the bisect which one of the 3 things above are you referring to?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2323358</commentid>
    <comment_count>6</comment_count>
    <who name="Iyán M. V.">me</who>
    <bug_when>2024-05-30 12:26:22 +0000</bug_when>
    <thetext>Hi David,

Regarding point one I already added a comment because I couldn&apos;t update the original description. Indeed, when it works, the slides is in the &quot;Brightness and Color&quot; applet.

I first noticed the issues with the package provided by Arch Linux in the [kde-unstable] repo, which if I do `pacman -Ql powerdevil | grep plugins` lists the following:

powerdevil /usr/lib/qt6/plugins/
powerdevil /usr/lib/qt6/plugins/plasma/
powerdevil /usr/lib/qt6/plugins/plasma/kcms/
powerdevil /usr/lib/qt6/plugins/plasma/kcms/systemsettings/
powerdevil /usr/lib/qt6/plugins/plasma/kcms/systemsettings/kcm_powerdevilprofilesconfig.so
powerdevil /usr/lib/qt6/plugins/powerdevil/
powerdevil /usr/lib/qt6/plugins/powerdevil/action/
powerdevil /usr/lib/qt6/plugins/powerdevil/action/powerdevil_brightnesscontrolaction.so
powerdevil /usr/lib/qt6/plugins/powerdevil/action/powerdevil_dimdisplayaction.so
powerdevil /usr/lib/qt6/plugins/powerdevil/action/powerdevil_dpmsaction.so
powerdevil /usr/lib/qt6/plugins/powerdevil/action/powerdevil_handlebuttoneventsaction.so
powerdevil /usr/lib/qt6/plugins/powerdevil/action/powerdevil_keyboardbrightnesscontrolaction.so
powerdevil /usr/lib/qt6/plugins/powerdevil/action/powerdevil_powerprofileaction.so
powerdevil /usr/lib/qt6/plugins/powerdevil/action/powerdevil_runscriptaction.so
powerdevil /usr/lib/qt6/plugins/powerdevil/action/powerdevil_suspendsessionaction.so

For the git bisect I used the exact same PKGBUILD just changing the source to use the git repo and forcing the commit given by git bisect. Each build was done in a clean env using the [kde-unstable] repo (with kde-unstable-x86_64-build). And I was checking for the three issues.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2323387</commentid>
    <comment_count>7</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2024-05-30 13:33:57 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4378</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2323388</commentid>
    <comment_count>8</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2024-05-30 13:33:57 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4378</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2323426</commentid>
    <comment_count>9</comment_count>
    <who name="Fushan Wen">qydwhotmail</who>
    <bug_when>2024-05-30 16:07:54 +0000</bug_when>
    <thetext>Does `qdbus6 --system org.freedesktop.UPower /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.GetBrightness` return anything?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2323668</commentid>
    <comment_count>10</comment_count>
    <who name="Iyán M. V.">me</who>
    <bug_when>2024-05-31 14:35:06 +0000</bug_when>
    <thetext>(In reply to Fushan Wen from comment #9)
&gt; Does `qdbus6 --system org.freedesktop.UPower
&gt; /org/freedesktop/UPower/KbdBacklight
&gt; org.freedesktop.UPower.KbdBacklight.GetBrightness` return anything?

It returns a 0.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2323669</commentid>
    <comment_count>11</comment_count>
    <who name="Iyán M. V.">me</who>
    <bug_when>2024-05-31 14:35:52 +0000</bug_when>
    <thetext>And a 1 and a 2 in the two other two brightness modes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2323967</commentid>
    <comment_count>12</comment_count>
    <who name="Iyán M. V.">me</who>
    <bug_when>2024-06-02 13:15:55 +0000</bug_when>
    <thetext>On more thing I just discover. If I run `systemctl --user restart plasma-powerdevil.service`, everything works again. So the problem is that after that commit, and after a system reboot, it doesn´t work. The service has to be manually restarted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2325659</commentid>
    <comment_count>13</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2024-06-08 04:35:11 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/377</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2326845</commentid>
    <comment_count>14</comment_count>
    <who name="Fushan Wen">qydwhotmail</who>
    <bug_when>2024-06-12 04:12:37 +0000</bug_when>
    <thetext>Git commit 14f4cf0158d8565365dae1c5c55c2fac5801ef08 by Fushan Wen.
Committed on 12/06/2024 at 03:58.
Pushed by fusionfuture into branch &apos;master&apos;.

applets/brightness: test setting keyboard brightness

This adds a test to make sure the keyboard brightness slider works as
expected.

M  +6    -0    appiumtests/applets/CMakeLists.txt
A  +153  -0    appiumtests/applets/brightnesstest.py
M  +30   -0    appiumtests/utils/OrgFreedesktopUPower.py
M  +4    -2    applets/brightness/package/contents/ui/BrightnessItem.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/14f4cf0158d8565365dae1c5c55c2fac5801ef08</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2343985</commentid>
    <comment_count>15</comment_count>
    <who name="Thomas Baag">bugs.kde.org</who>
    <bug_when>2024-08-07 20:45:02 +0000</bug_when>
    <thetext>Hi,

I&apos;m also encountering this bug and can confirm it&apos;s rooted in the UPower service being stopped when PowerDevil tries to access it.

So `systemctl --user restart plasma-powerdevil.service` works.

To reproduce try:
systemctl --user stop plasma-powerdevil.service
sudo systemctl stop upower
systemctl --user start plasma-powerdevil.service

I&apos;m running Plasma 6.1.3 (on NixOS unstable).

Best</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2343995</commentid>
    <comment_count>16</comment_count>
    <who name="Thomas Baag">bugs.kde.org</who>
    <bug_when>2024-08-07 21:43:48 +0000</bug_when>
    <thetext>As a workaround I let the service ping the dbus address in ExecStartPre. WorksForMe.

cat .config/systemd/user/plasma-powerdevil.service.d/override.conf
[Service]
ExecStartPre=qdbus --system org.freedesktop.UPower /</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2353602</commentid>
    <comment_count>17</comment_count>
    <who name="Iyán M. V.">me</who>
    <bug_when>2024-09-13 18:27:57 +0000</bug_when>
    <thetext>This is still an issue in 6.1.90.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2377560</commentid>
    <comment_count>18</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2024-11-27 20:55:59 +0000</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 486067 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>