commit 60a47420a8887d7fcda37efe4b6baf730d9cc936 from: Russ Cox date: Sun Oct 07 13:48:47 2012 UTC 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 commit - 5b6028903dc9a0d1561a54764a520aaa1b1100e4 commit + 60a47420a8887d7fcda37efe4b6baf730d9cc936 blob - 0fd27d724a64638dbd1aa695f4e065e024e55461 blob + 04b13a038fa377d0baf0e3565c58b2b1eb08dcf0 --- src/cmd/devdraw/x11-init.c +++ 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; @@ -108,12 +114,6 @@ _xattach(char *label, char *winsize) || XMatchVisualInfo(_x.display, xrootid, 15, DirectColor, &xvi)){ _x.vis = xvi.visual; _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)