Repository navigation
fix(brightness): don't log an error when WMI brightness is unsupported - #1825
Merged
eythaann merged 1 commit intoSep 18, 2026
Merged
Conversation
On desktops with external displays the WmiMonitorBrightness provider has no
instances and the query fails with WBEM_E_NOT_SUPPORTED, so every start
logged "WMI(HResultError { hres: -2147217396 })" with no context. Treat
that case as "nothing to track" (debug log, empty list) and only spawn the
notification thread when the query succeeded, since it fails the same way.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01StkifHpSLWH4J5TvuP56ur
Contributor
|
eythaann
approved these changes
Sep 18, 2026
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
On desktops whose monitors don't expose brightness through WMI (external displays, no
WmiMonitorBrightnessinstances),BrightnessManager::init()fails withWBEM_E_NOT_SUPPORTEDand every start logs a context-free error:That is the expected answer of the provider on such hardware (
Get-CimInstance -Namespace root/wmi -ClassName WmiMonitorBrightnessfails the same way), not a fault, so this PR treats it as "nothing to track": the manager keeps an empty list and logs atdebuglevel instead. The notification thread is now only spawned when the initial query succeeded, since it fails with the same error and just died silently before.Changes
src/background/modules/monitors/brightness/application.rs: matchWMIError::HResultError { hres }againstWBEM_E_NOT_SUPPORTED(0x8004100C) ininit(); move the initial query before the thread spawn.Testing
[DEBUG][seelen_ui::modules::monitors::brightness::application] Monitor brightness is not supported through WMI on this system; app and service ran normally for the 120 s window. Not tested on a laptop with a WMI-capable panel (the success path is unchanged apart from the reordering).🤖 Generated with Claude Code