]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Merge pull request #117 from Janno/patch-1
authorPhillip Berndt <phillip.berndt@googlemail.com>
Tue, 25 Sep 2018 17:12:35 +0000 (19:12 +0200)
committerGitHub <noreply@github.com>
Tue, 25 Sep 2018 17:12:35 +0000 (19:12 +0200)
Consider screen rotation in `get_fb_dimensions`

README.md
autorandr.py

index dfbe3abbb4ddf404ae34863d7c3ae2e10c769725..b684441742628977890429d57c859492471a244d 100644 (file)
--- a/README.md
+++ b/README.md
@@ -56,6 +56,7 @@ Contributors to this version of autorandr are:
 * Timo Kaufmann
 * Tomasz Bogdal
 * Victor Häggqvist
+* Jan-Oliver Kaiser
 
 ## Installation/removal
 
index 4187932632c1bb008c3d88cad62a31f1f1912611..9524f4274d8275ca32bb9b53c8d55673cd1a5684 100755 (executable)
@@ -645,6 +645,9 @@ def get_fb_dimensions(configuration):
             x = (a * o_width + b * o_height + c) / w
             y = (d * o_width + e * o_height + f) / w
             o_width, o_height = x, y
+        if "rotate" in output.options:
+            if output.options["rotate"] in ("left", "right"):
+                o_width, o_height = o_height, o_width
         if "pos" in output.options:
             o_left, o_top = map(int, output.options["pos"].split("x"))
             o_width += o_left