Bug 406790 - No OSD shown when adjusting the keyboard backlight using keyboard keys that cycle through brightness levels rather than explicitly raising or lowering brightness
Summary: No OSD shown when adjusting the keyboard backlight using keyboard keys that c...
Status: RESOLVED FIXED
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 5.23.5
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Natalie Clarius
URL:
Keywords:
: 435416 450128 470453 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-04-22 23:10 UTC by George Vassilev
Modified: 2023-08-16 15:08 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description George Vassilev 2019-04-22 23:10:27 UTC
SUMMARY

I cannot see visual feedback when I adjust my keyboard brightness on my ASUS ROG GL552VW. I have the ASUS keyboard driver installed, python-dbus and much more things which I thought could fix the problem. On GNOME, I can see when I adjust my brightness. The keys themselves adjust the brightness, but KDE doesn't display it. However, if I configure it from Powerdevil itself by dragging the scroler it works.

STEPS TO REPRODUCE
I don't think I really need to explain how to press a button to adjust brightness. I guess 1st install Arch. 2nd install plasma. 3rd, do the same thing I did.

OBSERVED RESULT
Already explained at the top.

EXPECTED RESULT
Explained at the top as well.

SOFTWARE/OS VERSIONS
Windows: Not applicable
macOS: Not applicable
Linux/KDE Plasma: Arch Linux
(available in About System)
KDE Plasma Version: 5.15.4
KDE Frameworks Version: 5.57.0
Qt Version: 5.12.3

ADDITIONAL INFORMATION
Other than that you have to fix KWin when it comes to glxgears because when I maximize it my computer freezes for mad 30 seconds, I don't know what else I could say. I love the DE anyways. It's other than that stable and customizable.
Comment 1 Nate Graham 2021-04-06 14:45:30 UTC
*** Bug 435416 has been marked as a duplicate of this bug. ***
Comment 2 Nate Graham 2022-01-07 15:32:54 UTC
If I comment out `operation.silent = plasmoid.expanded;` in the applet code, then I see the OSD as expected when I change the slider in the applet. So it looks like the issue is that when manipulating the keyboard brightness using the keyboard shortcut, either `silent` is being inappropriately set, or else the OSD triggering code isn't used at all. Moving to Powerdevil since the applet isn't doing anything wrong here.
Comment 3 Nate Graham 2022-01-07 15:55:01 UTC
The bug here seems to be that KeyboardBrightnessControl::increaseKeyboardBrightness() and KeyboardBrightnessControl::decreaseKeyboardBrightness() aren't getting called when the keyboard brightness is triggered from the keyboard itself. But this does work for screen brightness. Maybe something not getting hooked up correctly.
Comment 4 Nate Graham 2022-01-07 16:10:32 UTC
I see the problem. The actions' default shortcuts are Qt::Key_KeyboardBrightnessUp and Qt::Key_KeyboardBrightnessDown. But many keyboards don't send those key events when you change the brightness.

For example, the increasingly common paradigm of using Fn+Space to cycle through brightness levels will not cause either of those key events to be emitted.

There is the Qt::Key_KeyboardLightOnOff key, but that doesn't seen to be bound to the "cycle through brightness levels" feature that Fn+Space implements. I guess that's for backlit keyboard with only one brightness level and a single key that toggles between on and off.

So it looks we will need to either manually handle those key events, or else add a new key definition to Qt that gets emitted when you cycle through keyboard brightness levels, and then handle that here in Powerdevil.
Comment 5 Nate Graham 2022-02-16 01:03:54 UTC
*** Bug 450128 has been marked as a duplicate of this bug. ***
Comment 6 Nate Graham 2023-06-05 04:22:37 UTC
*** Bug 470453 has been marked as a duplicate of this bug. ***
Comment 7 Werner Sembach [TUXEDO] 2023-06-05 09:52:51 UTC
Thanks for adding me to the loop.

I would apprechiate a proper keyboard backlight cycle key implementation. Just last week I probed the lkml for feedback and interest:

https://lore.kernel.org/all/20230530110550.18289-1-wse@tuxedocomputers.com/

I don't know how Qt keycodes map to linux kernel keycodes, because currently there are only 3 keycodes for backlight control in the kernel: Up, Down, and Toggle.

As we have quite a collection of different keyboard backlight, I'm able to provide testing and design feedback, so let me know when there is a prototype.


@George Vassilev: Die you have a cat /sys/class/leds/*kbd_backlight/brightness_hw_changed entry with the driver installed? ('*' = wildcard, maybe something like asus::kbd_backlight or asus:white:kbd_backlight or white:kbd_backlight)
Comment 8 Bug Janitor Service 2023-08-16 03:31:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/210
Comment 9 Natalie Clarius 2023-08-16 04:18:23 UTC
Git commit ae21f465adc72c84cee22ffd887a081dbe5019b9 by Natalie Clarius.
Committed on 16/08/2023 at 06:18.
Pushed by nclarius into branch 'kbd-backlight-hw-changed'.

show OSD when keyboard backlight changed through hardware

Show the brightness OSD when upower signals that the keyboard backlight changed through hardware, eg a firmware-handled shortcut, for which so far no OSD was shown.

FIXED-IN: 6.0

M  +10   -3    daemon/backends/upower/powerdevilupowerbackend.cpp
M  +1    -1    daemon/backends/upower/powerdevilupowerbackend.h
M  +6    -1    daemon/powerdevilbackendinterface.cpp
M  +1    -1    daemon/powerdevilbackendinterface.h

https://invent.kde.org/plasma/powerdevil/-/commit/ae21f465adc72c84cee22ffd887a081dbe5019b9
Comment 10 Natalie Clarius 2023-08-16 04:22:55 UTC
Ignore the above message, the fix has not landed, I just pushed to the wrong branch name
Comment 11 Natalie Clarius 2023-08-16 05:01:21 UTC
Sorry for the confusion!
Comment 12 Natalie Clarius 2023-08-16 15:08:19 UTC
Git commit 3d0a12cc7bc4b788ec012db1120c41e42b443425 by Natalie Clarius.
Committed on 16/08/2023 at 06:26.
Pushed by ngraham into branch 'master'.

show OSD when keyboard backlight changed through hardware

Show the brightness OSD when upower signals that the keyboard backlight changed through hardware, eg a firmware-handled shortcut, for which so far no OSD was shown.

FIXED-IN: 6.0

M  +8    -3    daemon/backends/upower/powerdevilupowerbackend.cpp
M  +1    -1    daemon/backends/upower/powerdevilupowerbackend.h
M  +6    -1    daemon/powerdevilbackendinterface.cpp
M  +1    -1    daemon/powerdevilbackendinterface.h

https://invent.kde.org/plasma/powerdevil/-/commit/3d0a12cc7bc4b788ec012db1120c41e42b443425