From 4042954b33400d48b194ebd888c9b7a7d97a4015 Mon Sep 17 00:00:00 2001 From: Kalmat Date: Mon, 22 Apr 2024 11:49:30 +0200 Subject: [PATCH] ALL: Added saveSetup() and restoreSetup(). Fixed / Improved watchdog (especially in Linux). Fixed / improved setPosition() method LINUX: Added ewmhlib as separate module. Fixed watchdog (freezing randomly invoking screen_resources and get_output_info), fixed workarea crash (some apps/environments do not set it), improved to work almost fine in Manjaro/KDE, avoid crashing in Wayland for "fake" :1 display (though module won't likely work) WIN32: Fixed dev.StateFlags returning weird values for multi-monitor. Fixed GetAwarenessFromDpiAwarenessContext not supported on Windows Server MACOS: Replaced display-manager-lib by other alternatives which seem to work in several macOS versions (brightness only) Added setScale() method (using a workaround). Added wakeup feature to turnOn() method --- src/pymonctl/_pymonctl_linux.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/pymonctl/_pymonctl_linux.py b/src/pymonctl/_pymonctl_linux.py index cc0ba58..6221b09 100644 --- a/src/pymonctl/_pymonctl_linux.py +++ b/src/pymonctl/_pymonctl_linux.py @@ -840,9 +840,7 @@ def _getMonitorsData(handle: Optional[int] = None) -> ( stopSearching = False roots: List[Tuple[Xlib.display.Display, Struct, XWindow]] = getRoots() for rootData in roots: - display: Xlib.display.Display = rootData[0] - screen: Struct = rootData[1] - root: XWindow = rootData[2] + display, screen, root = rootData try: mons = randr.get_monitors(root).monitors except: @@ -882,9 +880,7 @@ def _XgetAllMonitors(name: str = ""): stopSearching = False roots: List[Tuple[Xlib.display.Display, Struct, XWindow]] = getRoots() for rootData in roots: - display: Xlib.display.Display = rootData[0] - screen: Struct = rootData[1] - root: XWindow = rootData[2] + display, screen, root = rootData try: mons = randr.get_monitors(root).monitors except: @@ -952,9 +948,7 @@ def _XgetAllOutputs(name: str = ""): int, randr.GetOutputInfo]] = [] roots: List[Tuple[Xlib.display.Display, Struct, XWindow]] = getRoots() for rootData in roots: - display: Xlib.display.Display = rootData[0] - screen: Struct = rootData[1] - root: XWindow = rootData[2] + display, screen, root = rootData res = randr.get_screen_resources_current(root) for output in res.outputs: outputInfo = randr.get_output_info(display, output, res.config_timestamp)