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=-c;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 --- 9255c2f7050e3ab4d9f5e4e5665c4cc10255c4ad diff --combined autorandr.py index 7edf72f,7359aa2..e11628c --- a/autorandr.py +++ b/autorandr.py @@@ -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[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)