examples:randr use info.Connection to detect whether there has any Randr.Modes

This commit is contained in:
snyh
2013-12-31 09:20:13 +08:00
committed by Přemysl Janouch
parent 64c6e6170d
commit 1f8bd79abe

View File

@@ -45,7 +45,7 @@ func main() {
log.Fatal(err)
}
if len(info.Modes) > 0 {
if info.Connection == randr.ConnectionConnected {
bestMode := info.Modes[0]
for _, mode := range resources.Modes {
if mode.Id == uint32(bestMode) {