After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 725655 - Keyboard brightness slider in Power is flaky
Keyboard brightness slider in Power is flaky
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Power
3.11.x
Other Linux
: Normal normal
: ---
Assigned To: Richard Hughes
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-03-04 14:09 UTC by Timur Kristóf
Modified: 2017-05-24 14:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
power: emit correct value for set keyboard backlight (2.05 KB, patch)
2017-01-25 19:14 UTC, Adam Goode
rejected Details | Review

Description Timur Kristóf 2014-03-04 14:09:36 UTC
In Settings -> Power there is an option to set the keyboard backlight brightness. However, the slider allows more values than the keyboard actually has. The keyboard on my laptop has 3 possible brightness levels, but on this slider I can set it "inbetween" which means that when I start dragging the slider button from 0, I have to drag it to 1/3 of the slider to see my keyboard backlight turn on.

It would be much better if the slider snapped to possible values and didn't allow the user to set it to an invalid value.

Another issue that I noticed with the keyboard brightness slider is that it can get out of sync with the indicator overlay in gnome-shell (the thing that appears when I change keyboard backlight using hotkeys).

Version:
control-center-3.11.90-2.fc20.x86_64
Comment 1 Bastien Nocera 2015-01-28 14:55:18 UTC
What laptop is this? We should probably just hide the slider on those types of keyboard (that's the reason why I didn't implement the kernel driver for the Lenovo X1 Carbon, for example).
Comment 2 Timur Kristóf 2015-01-29 06:43:08 UTC
I don't think you should hide the slider, because the keyboard backlight itself works perfectly fine. I'm only saying that the slider should behave a bit better.
I'm now using Gnome 3.14.2 and the bug is now different: now if I click on the slider, it always goes to zero. But if I change the backlight with the Fn+F3 / Fn+F4 keys, the slider goes to the correct value.

The machine is an Asus UX31A, and I can create a video for you that shows the problem, if the description is not descriptive enough.
Comment 3 Timur Kristóf 2015-05-10 16:39:32 UTC
> if I click on the slider, it always goes to zero.

This is still present on a fresh Fedora 22 install.
Comment 4 Bastien Nocera 2015-05-13 12:43:38 UTC
We have similar problems for some sound devices (like Bluetooth devices), which don't have fine-grained volume levels (limited to, say, 9).

See bug 581915
Comment 5 Britt Yazel 2015-11-16 04:58:29 UTC
I have this same problem on my XPS 13. The slider always remains at 0%, but if I click at the 50% mark or the 100% mark I can control the keyboard brightness levels. However, like I said before, the slider stays visually at 0% the whole time. I agree with the OP that for keyboards with fixed brightness settings (rather than a flexible scale) the slider should snap to those points.
Comment 6 Atri 2016-06-20 19:43:34 UTC
Also seen with 3.20.x (see https://bugzilla.opensuse.org/show_bug.cgi?id=978348)
Comment 7 ryanvade 2016-08-01 23:17:17 UTC
Confirming the same thing on my Inspiron 15 7000 series that has values 0, 1, and 2 for keyboard backlight on 3.20.2 Arch Linux.
Comment 8 Timur Kristóf 2016-08-02 10:53:48 UTC
Same thing is still reproducible on Fedora 24 and Gnome 3.20.2
Comment 9 Bastien Nocera 2016-08-02 10:58:49 UTC
Somebody with the hardware will need to fix this.
Comment 10 Adam Goode 2017-01-20 05:08:50 UTC
I looked very briefly at the code involved. It looks like upower and even gnome-settings-daemon do read out the max_brightness properly. Probably there is some factor missing to map the max_brightness to 100 on the scale?
Comment 11 Adam Goode 2017-01-20 05:45:50 UTC
As I drag the slider, I see the value sent across in percent, but the return in absolute numbers:

method call time=1484891064.141822 sender=:1.374 -> destination=:1.33 serial=672 path=/org/gnome/SettingsDaemon/Power; interface=org.freedesktop.DBus.Properties; member=Set
   string "org.gnome.SettingsDaemon.Power.Keyboard"
   string "Brightness"
   variant       int32 56
signal time=1484891064.149065 sender=:1.33 -> destination=(null destination) serial=4248 path=/org/gnome/SettingsDaemon/Power; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.gnome.SettingsDaemon.Power.Keyboard"
   array [
      dict entry(
         string "Brightness"
         variant             int32 1
      )
   ]
   array [
   ]
method return time=1484891064.149236 sender=:1.33 -> destination=:1.374 serial=4249 reply_serial=672

So I'm guessing it's a bug in settings daemon?
Comment 12 Adam Goode 2017-01-20 05:58:12 UTC
It's here:

brightness_value = PERCENTAGE_TO_ABS (0, manager->priv->kbd_brightness_max,
                                                      brightness_value);
                if (upower_kbd_set_brightness (manager, brightness_value, error)) {
                        backlight_iface_emit_changed (manager, GSD_POWER_DBUS_INTERFACE_KEYBOARD, brightness_value);
                        return TRUE;
  


It converts brightness_value from percent to abs, calls upower, but then emits the abs, not the percent.

I will look into making a patch in the next few days.
Comment 13 Adam Goode 2017-01-25 19:14:33 UTC
Created attachment 344256 [details] [review]
power: emit correct value for set keyboard backlight
Comment 14 Bjørn Lie 2017-01-25 21:14:21 UTC
Works for me, awesome Adam!
Comment 15 Adam Goode 2017-04-20 17:49:35 UTC
Do I need to do anything else to have someone review the patch? Thanks!
Comment 16 Adam Goode 2017-05-18 12:43:42 UTC
Ping
Comment 17 Rui Matos 2017-05-24 14:33:55 UTC
Review of attachment 344256 [details] [review]:

thanks for the patch. I think this was fixed in https://git.gnome.org/browse/gnome-settings-daemon/commit/?id=2b28b00a7e9ef21d3b94277e517692896e46e58c
Comment 18 Rui Matos 2017-05-24 14:35:02 UTC
please re-open if this still happens with versions >= 3.24
Comment 19 Adam Goode 2017-05-24 14:37:17 UTC
Fantastic!