]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Merge pull request #138 from jschwab/fix-panning-bug
authorPhillip Berndt <phillip.berndt@googlemail.com>
Sun, 17 Feb 2019 11:49:10 +0000 (12:49 +0100)
committerGitHub <noreply@github.com>
Sun, 17 Feb 2019 11:49:10 +0000 (12:49 +0100)
Fix case in which x and y are not specified in panning

1  2 
autorandr.py

diff --combined autorandr.py
index 7edf72fb243d66404a094da3b02813942b704a78,7359aa2831e327ed8ed97c961526bb9f03252177..e11628c4959e16e2096aa325e70b3eca55617a0b
@@@ -317,7 -317,7 +317,7 @@@ class XrandrOutput(object)
          else:
              edid = "%s-%s" % (XrandrOutput.EDID_UNAVAILABLE, match["output"])
  
 -        if not match["width"]:
 +        if not match["connected"]:
              options["off"] = None
          else:
              if match["mode_name"]:
@@@ -656,9 -656,9 +656,9 @@@ def get_fb_dimensions(configuration)
          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"))
+                 detail = match.groupdict(default="0")
+                 o_width = int(detail.get("w")) + int(detail.get("x"))
+                 o_height = int(detail.get("h")) + int(detail.get("y"))
          width = max(width, o_width)
          height = max(height, o_height)
      return int(width), int(height)