diff options
| author | Andrew Gallant <[email protected]> | 2013-12-30 18:23:55 -0800 |
|---|---|---|
| committer | Andrew Gallant <[email protected]> | 2013-12-30 18:23:55 -0800 |
| commit | efcb6d44d2722be3a77fe5292f5bfd5e73ed7e48 (patch) | |
| tree | 1f78d25b7c8db4ec3df71c98007aebfea7564b8f /examples/randr/main.go | |
| parent | 9c952b021ced9543d1602e60ba4189e4a2f71414 (diff) | |
| parent | f96506e570f53aa7e93e2a14dec6f9e0717a4fd7 (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.go | 10 |
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) + } } } } |
