diff options
author | Russ Cox <rsc@swtch.com> | 2012-10-07 09:48:47 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2012-10-07 09:48:47 -0400 |
commit | 60a47420a8887d7fcda37efe4b6baf730d9cc936 (patch) | |
tree | 8f86960f2f579c926f7b8b4e6693eaa9850c5351 /src | |
parent | 5b6028903dc9a0d1561a54764a520aaa1b1100e4 (diff) | |
download | plan9port-60a47420a8887d7fcda37efe4b6baf730d9cc936.tar.gz plan9port-60a47420a8887d7fcda37efe4b6baf730d9cc936.tar.bz2 plan9port-60a47420a8887d7fcda37efe4b6baf730d9cc936.zip |
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 (limited to 'src')
-rw-r--r-- | src/cmd/devdraw/x11-init.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cmd/devdraw/x11-init.c b/src/cmd/devdraw/x11-init.c index 0fd27d72..04b13a03 100644 --- 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){ |