--- libkbdraw/keyboard-drawing.c	2005/04/07 10:38:40	1.1
+++ libkbdraw/keyboard-drawing.c	2005/04/08 00:18:07
@@ -1550,10 +1550,19 @@ keyboard_drawing_init (
                                  XkbGBN_GeometryMask | XkbGBN_KeyNamesMask |
                                  XkbGBN_OtherNamesMask | XkbGBN_SymbolsMask |
                                  XkbGBN_IndicatorMapMask, XkbUseCoreKbd);
-  if (drawing->xkb == NULL)
+  if (drawing->xkb == NULL) {
     g_critical ("XkbGetKeyboard failed to get keyboard from the server!");
+    /* try to construct drawing->xkb the hard way */
+    drawing->xkb = XkbAllocKeyboard();
+    g_return_if_fail (drawing->xkb);
+    g_return_if_fail (XkbGetGeometry (drawing->display, drawing->xkb) 
+	    == Success);
+    g_return_if_fail (XkbGetIndicatorMap (drawing->display, -1, drawing->xkb)
+	    == Success);
+  }
 
-  XkbGetNames (drawing->display, XkbAllNamesMask, drawing->xkb);
+  g_return_if_fail (XkbGetNames (drawing->display, XkbAllNamesMask, 
+	      drawing->xkb) == Success);
 
   drawing->xkbOnDisplay = TRUE;
 
