example/randr: check the GetOutputInfo's mode length (virtual head can have zero mode)
This commit is contained in:
@@ -45,6 +45,7 @@ func main() {
|
|||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(info.Modes) > 0 {
|
||||||
bestMode := info.Modes[0]
|
bestMode := info.Modes[0]
|
||||||
for _, mode := range resources.Modes {
|
for _, mode := range resources.Modes {
|
||||||
if mode.Id == uint32(bestMode) {
|
if mode.Id == uint32(bestMode) {
|
||||||
@@ -52,6 +53,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fmt.Println("\n")
|
fmt.Println("\n")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user