]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Add --panning support to --fb auto-value
authorPhillip Berndt <phillip.berndt@googlemail.com>
Sun, 15 Apr 2018 16:14:56 +0000 (18:14 +0200)
committerPhillip Berndt <phillip.berndt@googlemail.com>
Sun, 15 Apr 2018 16:15:08 +0000 (18:15 +0200)
autorandr.py

index ca761b0e99bd85aaa180b9cba3902004c10821d9..db95507477819f0dbae90cd12a131a67ad48c244 100755 (executable)
@@ -649,6 +649,12 @@ def get_fb_dimensions(configuration):
             o_left, o_top = map(int, output.options["pos"].split("x"))
             o_width += o_left
             o_height += o_top
+        if "panning" in output.options:
+            match = re.match("(?P<w>[0-9]+)x(?P<h>[0-9]+)(?:\+(?P<x>[0-9]+))?(?:\+(?P<y>[0-9]+))?.*", output.options["panning"])
+            if match:
+                detail = match.groupdict()
+                o_width = int(detail.get("w")) + int(detail.get("x", "0"))
+                o_height = int(detail.get("h")) + int(detail.get("y", "0"))
         width = max(width, o_width)
         height = max(height, o_height)
     return int(width), int(height)