Skip to content

Commit

Permalink
Set the log level of Windows DPI awareness messages to 'info'
Browse files Browse the repository at this point in the history
Re: #289.

This change suppresses a message that appears when Dragonfly is first
imported on Windows 8.1 and above.  The message may be re-enabled by
setting the logging level of the "monitor.init" logger to 'info'.
  • Loading branch information
drmfinlay committed Sep 12, 2022
1 parent a56f938 commit 64df79d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dragonfly/windows/win32_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
hresult = ctypes.windll.shcore.SetProcessDpiAwareness(value)
hresult &= 0xffffffff
if hresult == 0x80070057: # E_INVALIDARG
log.warning("DPI awareness could not be set; "
"SetProcessDpiAwareness() received an invalid "
"argument: %d", value)
log.info("DPI awareness could not be set; "
"SetProcessDpiAwareness() received an invalid "
"argument: %d", value)
elif hresult == 0x80070005: # E_ACCESSDENIED
log.warning("DPI awareness could not be set; it has been set "
"already.")
log.info("DPI awareness could not be set; it has been set ")
"already.")
except OSError:
# Do nothing if SetProcessDpiAwareness() could not be called.
pass
Expand Down

0 comments on commit 64df79d

Please sign in to comment.