aboutsummaryrefslogtreecommitdiff
path: root/prototypes/xgb-image.go
diff options
context:
space:
mode:
Diffstat (limited to 'prototypes/xgb-image.go')
-rw-r--r--prototypes/xgb-image.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/prototypes/xgb-image.go b/prototypes/xgb-image.go
index c6ab02c..b8bf145 100644
--- a/prototypes/xgb-image.go
+++ b/prototypes/xgb-image.go
@@ -117,14 +117,15 @@ func main() {
// the backpixel value. (And we reject it in 30-bit depth anyway.)
for _, i := range screen.AllowedDepths {
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 {
continue
}
- if prefer30 && i.Depth == 30 ||
- !prefer30 && i.Depth == 32 {
+ if i.Depth == 32 || i.Depth == 30 && prefer30 {
visual, depth = v.VisualId, i.Depth
- break
+ if !prefer30 || i.Depth == 30 {
+ break
+ }
}
}
}