diff options
| author | Richard M. Stallman | 1996-08-24 00:03:22 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-08-24 00:03:22 +0000 |
| commit | 51b592fb337528c8e5c14376d4ff9e08db43b868 (patch) | |
| tree | 75c8fca998f53d9c321ba7d849fd4d71ebc5f1e8 /src | |
| parent | 0072414b409e8c8cac2bad0cf25c976fa6c4289f (diff) | |
| download | emacs-51b592fb337528c8e5c14376d4ff9e08db43b868.tar.gz emacs-51b592fb337528c8e5c14376d4ff9e08db43b868.zip | |
(x_term_init): If the default Xt font does not exist on
the X server, add a resource so that dialog boxes use a common font.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/xterm.c b/src/xterm.c index 5dfffb0ef8e..78c427bf904 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -6108,6 +6108,30 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 6108 | init_sigio (connection); | 6108 | init_sigio (connection); |
| 6109 | #endif /* ! defined (SIGIO) */ | 6109 | #endif /* ! defined (SIGIO) */ |
| 6110 | 6110 | ||
| 6111 | #ifdef USE_LUCID | ||
| 6112 | /* Make sure that we have a valid font for dialog boxes | ||
| 6113 | so that Xt does not crash. */ | ||
| 6114 | { | ||
| 6115 | Display *dpy = dpyinfo->display; | ||
| 6116 | XrmValue d, fr, to; | ||
| 6117 | Font font; | ||
| 6118 | |||
| 6119 | d.addr = (XPointer)&dpy; | ||
| 6120 | d.size = sizeof (Display *); | ||
| 6121 | fr.addr = XtDefaultFont; | ||
| 6122 | fr.size = sizeof (XtDefaultFont); | ||
| 6123 | to.size = sizeof (Font *); | ||
| 6124 | to.addr = (XPointer)&font; | ||
| 6125 | x_catch_errors (dpy); | ||
| 6126 | if (!XtCallConverter (dpy, XtCvtStringToFont, &d, 1, &fr, &to, NULL)) | ||
| 6127 | abort (); | ||
| 6128 | if (x_had_errors_p (dpy) || !XQueryFont (dpy, font)) | ||
| 6129 | XrmPutLineResource (&xrdb, "Emacs.dialog.*.font: 9x15"); | ||
| 6130 | x_uncatch_errors (dpy); | ||
| 6131 | } | ||
| 6132 | #endif | ||
| 6133 | |||
| 6134 | |||
| 6111 | UNBLOCK_INPUT; | 6135 | UNBLOCK_INPUT; |
| 6112 | 6136 | ||
| 6113 | return dpyinfo; | 6137 | return dpyinfo; |