Skip to content

Brightness (Linux): fixes random built-in flag and stdout leak in DDC/CI detection - #2616

Merged
CarterLi merged 1 commit into
fastfetch-cli:devfrom
ihsandeniz:fix/brightness-ddcutil
Sep 26, 2026
Merged

CarterLi merged 1 commit into
fastfetch-cli:devfrom
ihsandeniz:fix/brightness-ddcutil

Conversation

@ihsandeniz

@ihsandeniz ihsandeniz commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes two problems in detectWithDdcci (src/detection/brightness/brightness_linux.c), described with measurements in #2615:

  • DDC/CI results never set builtin. FF_LIST_ADD does not zero the element, so external monitors were labelled [Built-in] or [External] at random.
  • FF_SUPPRESS_IO() was scoped to the if (ffddca_init) block, so stdout was restored before display detection ran, and libddcutil trace lines could end up in the output, including ahead of --format json.

Related issue (required for new logos for new distros)

Closes #2615

Changes

  • Set brightness->builtin = false for DDC/CI results, matching the BSD DDC/CI backend.
  • Move FF_SUPPRESS_IO() to function scope so it covers ddca_init, ddca_get_display_info_list2, ddca_open_display2 and the VCP read. This also covers the FF_DISABLE_DLOPEN build, which previously had no suppression.
  • CHANGELOG entry under 2.69.0 Bugfixes.

Screenshots

Not a visual change. Before and after, same machine (Arch, Hyprland, 3 external monitors over DDC/CI, ddcutil 3.0.1), dev @ c3164d1:

build runs JSON failed to parse DDC/CI entries with builtin: true trace line in --pipe output
unmodified 50 8 13 of 123¹ 4
this PR 50 0 0 of 145 0

¹ Counted over the 42 runs whose JSON parsed. The entry count also varies because ddcutil occasionally misses one of the three monitors.

Checklist

  • I have tested my changes locally.

clang-format --dry-run reports no changes for the edited file, ctest passes (19/19), and -c presets/all.jsonc --format json parses on the patched build, with the same set of modules reporting errors as the unmodified build (all environment-related here, e.g. no terminal attached).

…/CI detection

DDC/CI results never set `builtin`, and FF_LIST_ADD does not zero the new
element, so external monitors were reported as built-in or external at
random. Set it to false, as the BSD DDC/CI backend does.

FF_SUPPRESS_IO() was declared inside the `if (ffddca_init)` block, so its
cleanup restored stdout before display detection ran and libddcutil trace
lines could reach the output, ahead of `--format json` too. Declare it at
function scope so it covers the whole detection, including the
FF_DISABLE_DLOPEN build.

Closes fastfetch-cli#2615
@ihsandeniz
ihsandeniz force-pushed the fix/brightness-ddcutil branch from 2649178 to 25efa96 Compare September 26, 2026 06:55
@CarterLi
CarterLi merged commit 9801d89 into fastfetch-cli:dev Sep 26, 2026
CarterLi pushed a commit that referenced this pull request Sep 27, 2026
* Vulkan: fixes driver name concatenation on multi-GPU systems

applyDriverName appended to the result buffer without clearing it. When
a later device reported a higher API version, its driver name was
appended to the name of the earlier device instead of replacing it, as
the comment in detectVulkan intends.

* CHANGELOG: moves the #2615 entry to Unreleased

#2616 was opened after 2.69.0 had been released, but its entry was
written under 2.69.0 Bugfixes, so the changelog listed the fix as part
of 2.69.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Brightness (Linux): DDC/CI monitors randomly reported as built-in; libddcutil trace output can break --format json

2 participants