Skip to content

Commit 1a37be0

Browse files
committed
Detect tracking/border information for --panning
1 parent 98cbc6f commit 1a37be0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

autorandr.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ class XrandrOutput(object):
9696
)? # .. but everything of the above only if the screen is in use.
9797
(?:[\ \t]*\([^\)]+\))(?:\s*[0-9]+mm\sx\s[0-9]+mm)?
9898
(?:[\ \t]*panning\ (?P<panning>[0-9]+x[0-9]+\+[0-9]+\+[0-9]+))? # Panning information
99+
(?:[\ \t]*tracking\ (?P<tracking>[0-9]+x[0-9]+\+[0-9]+\+[0-9]+))? # Tracking information
100+
(?:[\ \t]*border\ (?P<border>(?:[0-9]+/){3}[0-9]+))? # Border information
99101
(?:\s*(?: # Properties of the output
100102
Gamma: (?P<gamma>[0-9\.: ]+) | # Gamma value
101103
Transform: (?P<transform>(?:[\-0-9\. ]+\s+){3}) | # Transformation matrix
@@ -241,7 +243,12 @@ def from_xrandr_output(cls, xrandr_output):
241243
options["reflect"] = "xy"
242244
options["pos"] = "%sx%s" % (match["x"], match["y"])
243245
if match["panning"]:
244-
options["panning"] = match["panning"]
246+
panning = [ match["panning"] ]
247+
if match["tracking"]:
248+
panning += [ "/", match["tracking"] ]
249+
if match["border"]:
250+
panning += [ "/", match["border"] ]
251+
options["panning"] = "".join(panning)
245252
if match["transform"]:
246253
transformation = ",".join(match["transform"].strip().split())
247254
if transformation != "1.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,1.000000":

0 commit comments

Comments
 (0)