$NetBSD: patch-ae,v 1.1 2006/06/13 13:24:36 dsainty Exp $ Don't fail if the display has multiple visuals. Just default to the default one and don't concern ourselves with the others. Check if MIT-SHM is available before trying XShmQueryVersion(), since XShmQueryVersion() will abort outright if MIT-SHM isn't available. --- src/Screen.c.orig 2002-01-16 04:46:43.000000000 +1300 +++ src/Screen.c 2006-06-03 19:08:48.000000000 +1200 @@ -286,11 +286,6 @@ VisualTmpl.depth = DefDepth; MyVisual = XGetVisualInfo ( dpy, VisualScreenMask | VisualDepthMask, &VisualTmpl, &visuals ); - if ( visuals != 1 ) { - fprintf ( stderr, "can't handle default screen with multiple " - "visuals\n" ); - exit ( 1 ); - } VisualClass = MyVisual->class; XFree ( MyVisual ); @@ -381,7 +376,8 @@ * See if we can use shared memory */ - if ( XShmQueryVersion ( dpy, &dummy, &dummy, &SharedPixmapSupport )) + if ( XShmQueryExtension ( dpy ) && + XShmQueryVersion ( dpy, &dummy, &dummy, &SharedPixmapSupport )) { if ( SharedPixmapSupport ) {