Repository navigation
Conversation
added 2 commits
October 15, 2026 00:03
When running under Wayland or on modern Linux distributions without
legacy UPower KbdBacklight, the keyboard backlight and display brightness
controls disappear from the power applet (Cinnamon issue #13854).
1. Keyboard backlight:
- Probe /sys/class/leds/ for devices matching '*kbd_backlight*' if UPower
does not provide the KbdBacklight interface or has no methods.
- Read current and maximum brightness directly from sysfs.
- Watch brightness_hw_changed for hotkey / firmware updates.
- Control brightness using systemd-logind's SetBrightness method on
/org/freedesktop/login1/session/auto.
2. Display backlight and Wayland resilience:
- In csd-backlight-helper, validate that candidate backlight devices have
a readable max_brightness > 0 before selecting them, preventing broken
ACPI video devices on hybrid graphics laptops from breaking backlight
controls. Fall back to any available valid backlight device if preference
matching finds no usable candidate.
- In on_rr_screen_acquired(), do not abort initialization if GnomeRRScreen
fails to acquire under Wayland; proceed with sysfs and helper fallbacks.
- Guard X11 DPMS calls with GDK_IS_X11_DISPLAY() to prevent crashes under Wayland.
Member
|
Please stop, I can do this myself if I wanted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem Description
When running under Wayland or on modern Linux distributions without legacy UPower
KbdBacklight, the keyboard backlight and display brightness controls disappear from the Cinnamon power applet (Cinnamon issue linuxmint/cinnamon#13854).Root Causes
csd-power-manager.cexclusively queriedorg.freedesktop.UPowerat path/org/freedesktop/UPower/KbdBacklight. Modern distributions (Debian 12/13, Ubuntu 24.04+, systemd >= 252) no longer exposeKbdBacklighton UPower when managed directly by logind or when no device was present at upowerd start. When UPower fails, CSD set max brightness to 0 and returnedNOT_SUPPORTED, causingpower@cinnamon.org/applet.jsto never show the slider.csd-backlight-helper.c, preference matching stopped at the first match even if the candidate interface (e.g. inactive ACPI video device on hybrid AMD+NVIDIA laptops) had an unreadable or zeromax_brightness. Furthermore,on_rr_screen_acquired()aborted the entire CSD power manager initialization on error instead of continuing with sysfs fallbacks, and called X11 DPMS functions unguarded on Wayland displays.Changes Made
/sys/class/leds/for devices matching*kbd_backlight*if UPower does not provide theKbdBacklightinterface.brightness_hw_changedviaGIOChannelfor hardware/hotkey changes.org.freedesktop.login1.Session.SetBrightness("leds", device, value)on/org/freedesktop/login1/session/auto.csd-backlight-helper.c, validate that candidate devices have readablemax_brightness > 0before selecting them, and fall back to any valid backlight device.on_rr_screen_acquired(), do not abort on GnomeRRScreen acquisition errors under Wayland; proceed with sysfs and helper fallbacks.GDK_IS_X11_DISPLAY()to prevent crashes under Wayland.