diff options
| -rw-r--r-- | src/xterm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/xterm.c b/src/xterm.c index 2af69ca92a4..d562a3d2b1a 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -6682,6 +6682,7 @@ x_load_font (f, fontname, size) | |||
| 6682 | { | 6682 | { |
| 6683 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 6683 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
| 6684 | Lisp_Object font_names; | 6684 | Lisp_Object font_names; |
| 6685 | int count; | ||
| 6685 | 6686 | ||
| 6686 | /* Get a list of all the fonts that match this name. Once we | 6687 | /* Get a list of all the fonts that match this name. Once we |
| 6687 | have a list of matching fonts, we compare them against the fonts | 6688 | have a list of matching fonts, we compare them against the fonts |
| @@ -6718,7 +6719,16 @@ x_load_font (f, fontname, size) | |||
| 6718 | fontname = (char *) XSTRING (XCONS (font_names)->car)->data; | 6719 | fontname = (char *) XSTRING (XCONS (font_names)->car)->data; |
| 6719 | 6720 | ||
| 6720 | BLOCK_INPUT; | 6721 | BLOCK_INPUT; |
| 6722 | count = x_catch_errors (FRAME_X_DISPLAY (f)); | ||
| 6721 | font = (XFontStruct *) XLoadQueryFont (FRAME_X_DISPLAY (f), fontname); | 6723 | font = (XFontStruct *) XLoadQueryFont (FRAME_X_DISPLAY (f), fontname); |
| 6724 | if (x_had_errors_p (FRAME_X_DISPLAY (f))) | ||
| 6725 | { | ||
| 6726 | /* This error is perhaps due to insufficient memory on X | ||
| 6727 | server. Let's just ignore it. */ | ||
| 6728 | font = NULL; | ||
| 6729 | x_clear_errors (FRAME_X_DISPLAY (f)); | ||
| 6730 | } | ||
| 6731 | x_uncatch_errors (FRAME_X_DISPLAY (f), count); | ||
| 6722 | UNBLOCK_INPUT; | 6732 | UNBLOCK_INPUT; |
| 6723 | if (!font) | 6733 | if (!font) |
| 6724 | return NULL; | 6734 | return NULL; |