diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2021-07-15 02:02:38 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2021-08-01 03:36:23 +0200 |
commit | 5ab2977548006f98b8915283c014b0074f5fca04 (patch) | |
tree | 1eed3ce8625d3490d2466b734d0e1594e1c5a44c | |
parent | a927713a81321f84b1a1cd1675a142bf931ae510 (diff) | |
download | haven-5ab2977548006f98b8915283c014b0074f5fca04.tar.gz haven-5ab2977548006f98b8915283c014b0074f5fca04.tar.xz haven-5ab2977548006f98b8915283c014b0074f5fca04.zip |
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.
-rw-r--r-- | prototypes/xgb-image.go | 9 |
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 + } } } } |