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 c87604e commit bd167cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Binary file modified dist/PyMonCtl-0.0.10-py3-none-any.whl
Binary file not shown.
10 changes: 5 additions & 5 deletions src/pymonctl/_pymonctl_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ def _arrangeMonitors(arrangement: dict[str, dict[str, Union[str, int, Position,
arrInfo = arrangement[monName]

targetMonInfo = monitors[monName]["monitor"]
relativePos = arrInfo["relativePos"]
relativeTo = arrInfo["relativeTo"]
relativePos: Position = arrInfo["relativePos"]
relativeTo: str = arrInfo["relativeTo"]

targetMon = {"relativePos": relativePos, "relativeTo": relativeTo,
"position": Point(targetMonInfo.x, targetMonInfo.y),
Expand Down Expand Up @@ -591,8 +591,8 @@ def isOn(self) -> bool:
def attach(self):
# This produces the same effect, but requires to keep track of last mode used
if self._crtc:
crtcCode = self._crtc["crtc"]
crtcInfo = self._crtc["crtc_info"]
crtcCode: int = self._crtc["crtc"]
crtcInfo: Xlib.ext.randr.GetCrtcInfo = self._crtc["crtc_info"]
randr.set_crtc_config(self.display, crtcCode, Xlib.X.CurrentTime, crtcInfo.x, crtcInfo.y, crtcInfo.mode, crtcInfo.rotation, crtcInfo.outputs)
self._crtc = {}

Expand All @@ -603,7 +603,7 @@ def detach(self, permanent: bool = False):
display, screen, root, res, output, outputInfo = outputData
if outputInfo.crtc:
crtcInfo: Xlib.ext.randr.GetCrtcInfo = randr.get_crtc_info(display, outputInfo.crtc, Xlib.X.CurrentTime)
randr.set_crtc_config(display, cast(int, outputInfo.crtc), Xlib.X.CurrentTime, crtcInfo.x, crtcInfo.y, 0, crtcInfo.rotation, [])
randr.set_crtc_config(display, outputInfo.crtc, Xlib.X.CurrentTime, crtcInfo.x, crtcInfo.y, 0, crtcInfo.rotation, [])
self._crtc = {"crtc": outputInfo.crtc, "crtc_info": crtcInfo}


Expand Down

0 comments on commit bd167cd

Please sign in to comment.