xgb-image: fix visual searching

This commit is contained in:
Přemysl Eric Janouch 2021-11-15 12:12:02 +01:00
parent c3905349b0
commit ca245e4aca
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 2 additions and 1 deletions

View File

@ -115,6 +115,7 @@ func main() {
// XXX: We don't /need/ alpha here, it's just a minor improvement--affects
// the backpixel value. (And we reject it in 30-bit depth anyway.)
Depths:
for _, i := range screen.AllowedDepths {
for _, v := range i.Visuals {
// TODO: Could/should check other parameters, e.g., the RGB masks.
@ -124,7 +125,7 @@ func main() {
if i.Depth == 32 || i.Depth == 30 && prefer30 {
visual, depth = v.VisualId, i.Depth
if !prefer30 || i.Depth == 30 {
break
break Depths
}
}
}