summaryrefslogtreecommitdiff
path: root/examples/randr/main.go
diff options
context:
space:
mode:
authorAndrew Gallant <[email protected]>2013-12-30 18:23:55 -0800
committerAndrew Gallant <[email protected]>2013-12-30 18:23:55 -0800
commitefcb6d44d2722be3a77fe5292f5bfd5e73ed7e48 (patch)
tree1f78d25b7c8db4ec3df71c98007aebfea7564b8f /examples/randr/main.go
parent9c952b021ced9543d1602e60ba4189e4a2f71414 (diff)
parentf96506e570f53aa7e93e2a14dec6f9e0717a4fd7 (diff)
Merge pull request #19 from snyh/master
example/randr: check the GetOutputInfo's mode length (virtual head can h...
Diffstat (limited to 'examples/randr/main.go')
-rw-r--r--examples/randr/main.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/randr/main.go b/examples/randr/main.go
index ad575ee..414ef8d 100644
--- a/examples/randr/main.go
+++ b/examples/randr/main.go
@@ -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)
+ }
}
}
}