xgb-image: seek 32-bit visuals along with 30-bit

We only tried to upgrade to 32-bit depth when we weren't looking
for 30-bit visuals.  Probably of no practical consequence.
This commit is contained in:
Přemysl Eric Janouch 2021-07-15 02:02:38 +02:00
parent a927713a81
commit 5ab2977548
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -117,14 +117,15 @@ func main() {
// the backpixel value. (And we reject it in 30-bit depth anyway.) // the backpixel value. (And we reject it in 30-bit depth anyway.)
for _, i := range screen.AllowedDepths { for _, i := range screen.AllowedDepths {
for _, v := range i.Visuals { for _, v := range i.Visuals {
// TODO: Could/should check other parameters. // TODO: Could/should check other parameters, e.g., the RGB masks.
if v.Class != xproto.VisualClassTrueColor { if v.Class != xproto.VisualClassTrueColor {
continue continue
} }
if prefer30 && i.Depth == 30 || if i.Depth == 32 || i.Depth == 30 && prefer30 {
!prefer30 && i.Depth == 32 {
visual, depth = v.VisualId, i.Depth visual, depth = v.VisualId, i.Depth
break if !prefer30 || i.Depth == 30 {
break
}
} }
} }
} }