blob: 7f83e11ba4e96be8f9c171a63e69235d4a5bb690 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
--- graphics/x11drv/xfont.c.orig 2003-04-06 18:27:44.000000000 +0200
+++ graphics/x11drv/xfont.c 2003-04-06 18:27:58.000000000 +0200
@@ -2115,7 +2115,7 @@
}
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 );
@@ -3239,6 +3239,33 @@
return NULL;
}
+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;
+}
+
/* X11DRV Interface ****************************************************
|