mate-desktop / mate-power-manager

Power management tool for the MATE desktop
https://mate-desktop.org
GNU General Public License v2.0
59 stars 51 forks source link

mate-power-backlight-helper doesn't update the brightness applet value #384

Open balazs-endresz opened 1 year ago

balazs-endresz commented 1 year ago

Expected behaviour

pkexec mate-power-backlight-helper --set-brightness ... should update the value for the brightness applet

Actual behaviour

The applet remembers the previous value before mate-power-backlight-helper was called, so changing it via either the slider or scrolling over the icon results in a sudden jump of brightness (the latter with the recent scroll fix PR).

However, pressing the brightness keys on the laptop does keep the value in sync with the applet.

Steps to reproduce the behaviour

  1. set brightness via applet (or via dedicated brightness keys) to 100%
  2. run pkexec mate-power-backlight-helper --set-brightness 200 (i.e. set to a low value; max is over a thousand for me)
  3. mouse over the icon and start to scroll down, or press the down key when the applet popup is open
  4. instead of reducing the brightness from an already low value it jumps up to near 100% first and starts to reduce it from there

MATE general version

1.26.0

Package version

1.26.0

Linux Distribution

Ubuntu 22.04.1 LTS

Link to bugreport of your Distribution (requirement)

I logged in successfully from https://bugs.launchpad.net/ubuntu-mate/+bugs but then it asked me to log in again, which failed with the same saved password. But I'm happy to add a PR for this after some guidance.


How would one go about fixing this exactly? Is it possible to send a dbus message from gpm-backlight-helper.c to update the applet value? Or should we read the current actual brightness first before changing the value with the applet each time? Or perhaps update it only when the mouse hovers over the applet icon?