Skip to content

Commit

Permalink
Merge pull request BurntSushi#19 from snyh/master
Browse files Browse the repository at this point in the history
example/randr: check the GetOutputInfo's mode length (virtual head can h...
  • Loading branch information
BurntSushi committed Dec 31, 2013
2 parents 9c952b0 + f96506e commit efcb6d4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions examples/randr/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ func main() {
log.Fatal(err)
}

bestMode := info.Modes[0]
for _, mode := range resources.Modes {
if mode.Id == uint32(bestMode) {
fmt.Printf("Width: %d, Height: %d\n", mode.Width, mode.Height)
if info.Connection == randr.ConnectionConnected {
bestMode := info.Modes[0]
for _, mode := range resources.Modes {
if mode.Id == uint32(bestMode) {
fmt.Printf("Width: %d, Height: %d\n", mode.Width, mode.Height)
}
}
}
}
Expand Down

0 comments on commit efcb6d4

Please sign in to comment.