Skip to content

Commit

Permalink
pre-release tested OK in Linux/X11 (not Wayland) and win32 (macOS pen…
Browse files Browse the repository at this point in the history
…ding)
  • Loading branch information
Kalmat committed May 24, 2023
1 parent 91d7e69 commit cb021be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Binary file not shown.
25 changes: 13 additions & 12 deletions src/pymonctl/_pymonctl_macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,18 +248,19 @@ def _changeScale(scale: int, name: str = ""):
# kCGDisplayResolution = 1;
# kCGDisplayVerticalResolution = 72;
# }]
displayId = __getDisplayId(name)
if displayId:
screens = AppKit.NSScreen.screens()
for screen in screens:
desc = screen.deviceDescription()
if desc["NSScreenNumber"] == displayId:
allModes = _getAllowedModes(name)
for mode in allModes:
# or kCGDisplayHorizontalResolution, kCGDisplayVerticalResolution?
if len(mode) >= 1 and mode[0]["kCGDisplayResolution"] == (scale / 100):
Quartz.CGDisplaySetDisplayMode(displayId, mode, None)
return
# displayId = __getDisplayId(name)
# if displayId:
# screens = AppKit.NSScreen.screens()
# for screen in screens:
# desc = screen.deviceDescription()
# if desc["NSScreenNumber"] == displayId:
# allModes = _getAllowedModes(name)
# for mode in allModes:
# # or kCGDisplayHorizontalResolution, kCGDisplayVerticalResolution?
# if len(mode) >= 1 and mode[0]["kCGDisplayResolution"] == (scale / 100):
# Quartz.CGDisplaySetDisplayMode(displayId, mode, None)
# return
pass


def _changeOrientation(orientation: int, name: str = ""):
Expand Down

0 comments on commit cb021be

Please sign in to comment.