Conversation
High-resolution LED drivers can expose thousands of raw brightness levels. Creating one GtkScale mark per raw level makes the sidebar request a surface wider than GPU limits. Assisted-by: Claude Code:claude-sonnet-5 AI-Scope: Diagnosed an oversized sidebar surface from crash analysis on real T2 hardware and bounded keyboard-backlight tick marks while preserving all real brightness increments.
perlowja
force-pushed
the
fix/kbd-backlight-scale-marks
branch
from
September 21, 2026 00:29
a95bba6 to
1e7b0c1
Compare
Contributor
Author
|
@mirkobrombin bumping this one too - it's a real crash fix (keyboard-backlight GtkScale allocating a 29588x1406 EGL surface on high-resolution backlight controllers), metal-confirmed fixed. |
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.
Summary
SystemViewcreated oneGtkScalemark per raw hardware brightness level. On boards with a high-resolution backlight controller (Apple T2 reportsmax_brightness=14660), that's 14,661 marks, which made GTK compute a ~14,662px minimum widget width.dri2_query_image_common()crashed dereferencing it.set_increments()-- only the number of drawn marks changes, not slider precision or behavior.system_view.vala's keyboard-backlight slider only; no other sidebar widgets touched.Validation Evidence
Root-caused from real coredumps on a MacBookPro16,1 (T2, AMD Navi14) running this shell:
Six independent coredumps all showed the identical
29588x1406EGL buffer request. Confirmed the keyboard-backlight slider as the source by reading this file's mark-generation loop against the real hardware's reportedmax_brightness=14660.Built and installed the patched binary on the same real hardware:
This is a genuine upstream Mesa robustness gap too (missing NULL check after a failed EGL Wayland back-buffer allocation) -- already tracked as Mesa issue #15913 with an open, unmerged fix (MR !44569). This PR avoids generating the invalid surface in the first place, which is the fix within this repo's control; the Mesa MR remains valuable defense-in-depth regardless.
Security & Privacy
No security or privacy impact -- pure UI layout bound, no new data handling.
Compatibility
No behavior change for normal (low-resolution) brightness controllers. Preserves exact slider precision/increments for high-resolution controllers; only the number of visual tick marks is reduced.
Rollback
Revert this commit; no migrations or state changes involved.
AI assistance: disclosed