Tried a different tack ....

Phil Stracchino alaric at babcom.com
Fri Oct 5 12:03:38 CDT 2001


Oops, forgot to attach the updated patch.  Here it is.


-- 
  *********  Fight Back!  It may not be just YOUR life at risk.  *********
  phil stracchino   ::   alaric at babcom.com   ::   halmayne at sourceforge.net
    unix ronin     ::::   renaissance man   ::::   mystic zen biker geek
     2000 CBR929RR, 1991 VFR750F3 (foully murdered), 1986 VF500F (sold)
       Linux Now! ...because friends don't let friends use Microsoft.
-------------- next part --------------
--- graphics/x11drv/xfont.c.orig	Wed Sep 12 13:21:07 2001
+++ graphics/x11drv/xfont.c	Fri Oct  5 08:41:19 2001
@@ -1862,10 +1862,38 @@
     sprintf( p, ":%d.%d", display, screen );
     return buffer;
 }
 
 
+static int staticXError;
+
+static int fonterror_handler(Display *display,
+    XErrorEvent *error_evt)
+{
+    ERR("X error %d\n", error_evt->error_code);
+    return 0;
+}
+
+static XFontStruct * XFONT_GetFont(char *lpstr)
+{
+   XFontStruct*  x_fs;
+   void *ptr;
+
+   wine_tsx11_lock();
+   staticXError = FALSE;
+   ptr = XSetErrorHandler(fonterror_handler);
+   x_fs = XLoadQueryFont(gdi_display, lpstr);
+   XSync(gdi_display, False);
+   XSetErrorHandler(ptr);
+   wine_tsx11_unlock();
+   if (staticXError)
+      return NULL;
+   else
+      return x_fs;
+}
+
+
 /***********************************************************************
  *           X Font Matching
  *
  * Compare two fonts (only parameters set by the XFONT_InitFontInfo()).
  */
@@ -2072,11 +2100,11 @@
 	    
 	    lpstr = buffer;
 	}
 	else lpstr = x_pattern[i];
 
-	if( (x_fs = TSXLoadQueryFont(gdi_display, lpstr)) )
+	if( (x_fs = XFONT_GetFont(lpstr)) )
 	{	      
 	    XFONT_SetFontMetric( fi, fr, x_fs );
 	    TSXFreeFont( gdi_display, x_fs );
 
 	    XFONT_FixupPointSize(fi);


More information about the wine-users mailing list