Skip to content

Commit

Permalink
ALL: Added isSuspended property
Browse files Browse the repository at this point in the history
WIN32: Fixed setPosition() to avoid reseting other monitors to defaults
  • Loading branch information
Kalmat committed Sep 1, 2023
1 parent f68e357 commit 57b4fc3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Binary file modified dist/PyMonCtl-0.2-py3-none-any.whl
Binary file not shown.
4 changes: 2 additions & 2 deletions src/pymonctl/_pymonctl_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def setMode(self, mode: Optional[DisplayMode]):
devmode.PelsWidth = mode.width # type: ignore[misc]
devmode.PelsHeight = mode.height # type: ignore[misc]
devmode.DisplayFrequency = mode.frequency # type: ignore[misc]
devmode.Fields = win32con.DM_PELSWIDTH | win32con.DM_PELSHEIGHT # | win32con.DM_DISPLAYFREQUENCY # type: ignore[misc]
devmode.Fields = win32con.DM_PELSWIDTH | win32con.DM_PELSHEIGHT # type: ignore[misc]
win32api.ChangeDisplaySettingsEx(self.name, devmode, win32con.CDS_UPDATEREGISTRY) # type: ignore[arg-type]

@property
Expand All @@ -438,7 +438,7 @@ def allModes(self) -> list[DisplayMode]:
modes: List[DisplayMode] = []
while True:
try:
winSettings = win32api.EnumDisplaySettings(self.name, i, win32con.ENUM_REGISTRY_SETTINGS)
winSettings = win32api.EnumDisplaySettings(self.name, i)
mode = DisplayMode(winSettings.PelsWidth, winSettings.PelsHeight, winSettings.DisplayFrequency)
if mode not in modes:
modes.append(mode)
Expand Down

0 comments on commit 57b4fc3

Please sign in to comment.