From 97bc4d1889f48b94c6caf6415a748eb3088a46e8 Mon Sep 17 00:00:00 2001 From: Phillip Berndt Date: Sun, 15 Apr 2018 18:14:56 +0200 Subject: [PATCH] Add --panning support to --fb auto-value --- autorandr.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/autorandr.py b/autorandr.py index ca761b0..db95507 100755 --- a/autorandr.py +++ b/autorandr.py @@ -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[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")) width = max(width, o_width) height = max(height, o_height) return int(width), int(height) -- 2.39.2