From: Phillip Berndt Date: Sun, 17 Feb 2019 11:49:10 +0000 (+0100) Subject: Merge pull request #138 from jschwab/fix-panning-bug X-Git-Tag: 1.8~5 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9255c2f7050e3ab4d9f5e4e5665c4cc10255c4ad;hp=f923b9588c2d6d7a3cba081cfb18f363e0ff45ad;p=deb_pkgs%2Fautorandr.git Merge pull request #138 from jschwab/fix-panning-bug Fix case in which x and y are not specified in panning --- diff --git a/autorandr.py b/autorandr.py index 7edf72f..e11628c 100755 --- a/autorandr.py +++ b/autorandr.py @@ -656,9 +656,9 @@ def get_fb_dimensions(configuration): if "panning" in output.options: match = re.match("(?P[0-9]+)x(?P[0-9]+)(?:\+(?P[0-9]+))?(?:\+(?P[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)