Skip to content

Commit

Permalink
Merge pull request #368 from CasperH2O/FixBrightnessSliderQuickTools
Browse files Browse the repository at this point in the history
Fix brightness support detection.
  • Loading branch information
CasperH2O authored Feb 15, 2023
2 parents a25f065 + 3c43769 commit d131cfc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 0 additions & 3 deletions HandheldCompanion/Managers/DesktopManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,6 @@ public static void SetBrightness(double brightness)

public static short GetBrightness()
{
if (!BrightnessSupport)
return -1;

try
{
using (var mclass = new ManagementClass("WmiMonitorBrightness"))
Expand Down
4 changes: 4 additions & 0 deletions HandheldCompanion/Views/QuickPages/QuickSettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ public QuickSettingsPage()

DesktopManager.VolumeNotification += DeviceManager_VolumeNotification;
DesktopManager.BrightnessNotification += DesktopManager_BrightnessNotification;
DesktopManager.Initialized += DesktopManager_Initialized;
}

private void DesktopManager_Initialized()
{
// get current system brightness
switch (DesktopManager.HasBrightnessSupport())
{
Expand Down

0 comments on commit d131cfc

Please sign in to comment.