Monitorian icon indicating copy to clipboard operation
Monitorian copied to clipboard

Inability to get auto-brightness by ambient light sensor on some devices (Surface Pro 8)

Open emoacht opened this issue 2 years ago • 1 comments

I have been noticing that on some devices, namely Surface Pro 8, when auto-brightness by ambient light sensor is enabled, the actual adjusted brightness cannot be obtained by the functions currently available for desktop app (UWP is not included in desktop app).

I found that it can be obtained by BrightnessOverride.GetLevelForScenario method as shown below.

// using Windows.Graphics.Display;

BrightnessOverride bo = BrightnessOverride.GetForCurrentView();
double brightness = bo.GetLevelForScenario(DisplayBrightnessScenario.DefaultBrightness);

However, it requires GetForCurrentView method and it is clearly documented that it is not supported for desktop app and no alternative API is available.

Therefore, I don't think this issue can be solved in near future. Of cource, I would appreciate if anyone could provide a workable solution or workaround for this.

emoacht avatar Mar 15 '23 20:03 emoacht

To sum up what I have observed so far about the brightness adjusted by auto-brightness on Surface Pro 8, the behavior varies depending on the OS.

  • On Windows 10, the adjusted brightness is not reflected to the brightness obtained by WmiMonitorBrightness and thus cannot be tracked by desktop app.
  • On Windows 11, the adjusted brightness is mostly reflected to the brightness obtained by WmiMonitorBrightness AS WELL AS the brightness obtained by PowerReadACValueIndex or PowerReadDCValueIndex. It effectively prevents this app from obtaining the brightness which is actually set by the user.

In both OSs, it is difficult to interact with auto-brightness in the manner which I expected.

emoacht avatar Nov 17 '23 22:11 emoacht