From 45664e6138b2840decac28932de2fa0311da2fce Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 28 Nov 2019 23:07:10 +0100 Subject: [PATCH] Fixed issue with missing display resolution - under some circumstances xrandr returns no display resolution for a connected display - this case is manually handled, such a display will be ignored - added a log statement whenever the list of displays is updated --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index 53ff343..88e0525 100644 --- a/main.go +++ b/main.go @@ -189,6 +189,10 @@ func fetchDisplays() ([]display, error) { } return false }) + if len(vals) < 4 { + // no resolution? ignore + continue + } m.axis.x, _ = strconv.Atoi(vals[0]) m.axis.y, _ = strconv.Atoi(vals[1]) m.offset.x, _ = strconv.Atoi(vals[2]) @@ -197,6 +201,7 @@ func fetchDisplays() ([]display, error) { displays = append(displays, m) } + log.Println("Displays found:", displays) return displays, nil }