plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

commit 60a47420a8887d7fcda37efe4b6baf730d9cc936
parent 5b6028903dc9a0d1561a54764a520aaa1b1100e4
Author: Russ Cox <rsc@swtch.com>
Date:   Sun,  7 Oct 2012 09:48:47 -0400

devdraw: prefer 24-bit over 15-bit or 16-bit.

Fixes remote X11 use via XQuartz 2.7.4.

R=rsc
http://codereview.appspot.com/6624058

Diffstat:
Msrc/cmd/devdraw/x11-init.c | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/cmd/devdraw/x11-init.c b/src/cmd/devdraw/x11-init.c @@ -98,6 +98,12 @@ _xattach(char *label, char *winsize) /* * Figure out underlying screen format. */ + if(XMatchVisualInfo(_x.display, xrootid, 24, TrueColor, &xvi) + || XMatchVisualInfo(_x.display, xrootid, 24, DirectColor, &xvi)){ + _x.vis = xvi.visual; + _x.depth = 24; + } + else if(XMatchVisualInfo(_x.display, xrootid, 16, TrueColor, &xvi) || XMatchVisualInfo(_x.display, xrootid, 16, DirectColor, &xvi)){ _x.vis = xvi.visual; @@ -110,12 +116,6 @@ _xattach(char *label, char *winsize) _x.depth = 15; } else - if(XMatchVisualInfo(_x.display, xrootid, 24, TrueColor, &xvi) - || XMatchVisualInfo(_x.display, xrootid, 24, DirectColor, &xvi)){ - _x.vis = xvi.visual; - _x.depth = 24; - } - else if(XMatchVisualInfo(_x.display, xrootid, 8, PseudoColor, &xvi) || XMatchVisualInfo(_x.display, xrootid, 8, StaticColor, &xvi)){ if(_x.depth > 8){