fix(windows/capture): actually QUERY the HDR SDR-white scale — the refresh block was silently dropped
faad4b57 shipped the field, shader scale, and plumbing but the scripted edit inserting the sdr_white_level_scale() refresh in the scratch-rebuild arm matched nothing and silently no-op'd (no assert) — sdr_white_scale stayed at its 1.0 init, i.e. 80 nits, i.e. exactly the old dark cursor. Now queried on every scratch rebuild, with an info log of queried/applied so an HDR session shows what it uses. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1791,7 +1791,27 @@ impl IddPushCapturer {
|
||||
.map(|v| (t, v))
|
||||
});
|
||||
match built {
|
||||
Some((t, v)) => self.blend_scratch = Some((t, v, self.width, self.height, fmt)),
|
||||
Some((t, v)) => {
|
||||
self.blend_scratch = Some((t, v, self.width, self.height, fmt));
|
||||
if self.display_hdr {
|
||||
// Where DWM places SDR white on this HDR desktop — the composited
|
||||
// cursor must match or it reads dark (~2.5x at the Windows default).
|
||||
// Queried only here: scratch rebuilds are rare, and the CCD query
|
||||
// contends on the display-config lock, which must stay OFF the
|
||||
// per-frame path.
|
||||
// Safety: read-only CCD query over owned locals (within unsafe fn).
|
||||
let queried =
|
||||
pf_win_display::win_display::sdr_white_level_scale(self.target_id);
|
||||
self.sdr_white_scale = queried.unwrap_or(self.sdr_white_scale);
|
||||
tracing::info!(
|
||||
target_id = self.target_id,
|
||||
queried = ?queried,
|
||||
applied = self.sdr_white_scale,
|
||||
"cursor composite: HDR SDR-white scale (1.0 = 80 nits; None = \
|
||||
query failed — keeping the prior value)"
|
||||
);
|
||||
}
|
||||
}
|
||||
None => {
|
||||
if !self.cursor_blend_failed {
|
||||
self.cursor_blend_failed = true;
|
||||
|
||||
Reference in New Issue
Block a user