Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
emoacht opened this issue Mar 15, 2023 · 1 comment

Comments

@emoacht
Copy link
Owner

emoacht commented Mar 15, 2023

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 emoacht pinned this issue Mar 15, 2023
@emoacht
Copy link
Owner Author

emoacht commented Nov 17, 2023

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 emoacht unpinned this issue Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant