From 586db8574105176da2d169c6e36fcf956933a6f6 Mon Sep 17 00:00:00 2001 From: BlackMark Date: Sun, 5 Jul 2020 19:11:53 +0200 Subject: [PATCH] Add logging for failing to get monitor capabilities --- AdaptiveBrightness/monitor_win.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AdaptiveBrightness/monitor_win.cpp b/AdaptiveBrightness/monitor_win.cpp index c510b00..9aaaf57 100644 --- a/AdaptiveBrightness/monitor_win.cpp +++ b/AdaptiveBrightness/monitor_win.cpp @@ -7,6 +7,7 @@ #include + #include "get_last_error.hpp" #include "log_tr.hpp" Monitor::Monitor(HMONITOR hMonitor, PHYSICAL_MONITOR physicalMonitor) @@ -33,7 +34,9 @@ bool Monitor::hasBrightnessCapability() const DWORD colorTemperatures = 0; if(!GetMonitorCapabilities(m_physicalMonitor.handle, &monitorCapabilities, &colorTemperatures)) { - // TODO: Log error + qCritical(ltr("Failed to get capabilities for monitor '0x%1', error: %2") + .arg(reinterpret_cast(m_physicalMonitor.handle), 0, 16) + .arg(getLastErrorString())); return false; }