diff --git a/AdaptiveBrightness/main_window.cpp b/AdaptiveBrightness/main_window.cpp index 93d33e4..8a88d37 100644 --- a/AdaptiveBrightness/main_window.cpp +++ b/AdaptiveBrightness/main_window.cpp @@ -298,7 +298,9 @@ void MainWindow::updateState() bool errorOccurred = false; for(auto& monitor: m_monitors) { - monitor.brightness = monitor.manualOverride ? monitor.brightness : brightness; + if(!std::isnan(brightness) && !monitor.manualOverride) { + monitor.brightness = brightness; + } if(!monitor.driver.setBrightness(monitor.brightness)) { errorOccurred = true; } @@ -306,7 +308,7 @@ void MainWindow::updateState() return !errorOccurred; }; - auto brightness = 0.5f; + auto brightness = NAN; if(!getAverageSensorValue(brightness)) { enumSensors();