Skip to content

Commit

Permalink
ALL: Fixed watchdog thread
Browse files Browse the repository at this point in the history
LINUX: Added attach()/detach(), fixed setPosition() and arrangeMonitors()
WIN32: Fixed and improved many issues (scale still pending)
  • Loading branch information
Kalmat committed Aug 23, 2023
1 parent 2be12fa commit e8e8423
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Binary file modified dist/PyMonCtl-0.0.10-py3-none-any.whl
Binary file not shown.
6 changes: 3 additions & 3 deletions src/pymonctl/_pymonctl_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def _getAllMonitorsDict() -> dict[str, ScreenValue]:
wa: List[int] = getPropertyValue(getProperty(window=root, prop=Root.WORKAREA, display=display), display=display)
wx, wy, wr, wb = wa[0], wa[1], wa[2], wa[3]
dpiX, dpiY = round((w * 25.4) / (monitor.width_in_millimeters or 1)), round((h * 25.4) / (monitor.height_in_millimeters or 1))
scaleX, scaleY = _scale(monitorName) or 0, 0
scaleX, scaleY = _scale(monitorName) or (0.0, 0.0)
rot = int(math.log(crtcInfo.rotation, 2))
freq = 0.0
for mode in res.modes:
Expand All @@ -124,7 +124,7 @@ def _getAllMonitorsDict() -> dict[str, ScreenValue]:
'position': Point(x, y),
'size': Size(w, h),
'workarea': Rect(wx, wy, wr, wb),
'scale': (scaleX or 0.0, scaleY or 0.0),
'scale': (scaleX, scaleY),
'dpi': (dpiX, dpiY),
'orientation': rot,
'frequency': freq,
Expand Down Expand Up @@ -739,7 +739,7 @@ def _scale(name: str = "") -> Optional[Tuple[float, float]]:
dpiXDef, dpiYDef = round((wDef * 25.4) / wm), round((hDef * 25.4) / hm)
dpiX, dpiY = round((w * 25.4) / wm), round((h * 25.4) / hm)
if dpiX and dpiY and dpiXDef and dpiYDef:
scaleX, scaleY = round(100 / (dpiX / dpiXDef), 1), round(100 / (dpiY / dpiYDef), 1)
scaleX, scaleY = (100 / (dpiX / dpiXDef), 100 / (dpiY / dpiYDef))
return scaleX, scaleY
return None

Expand Down

0 comments on commit e8e8423

Please sign in to comment.