diff options
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/xterm.c b/src/xterm.c index 0e56b04c1b0..af35fbe8799 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -10586,9 +10586,12 @@ get_bits_and_offset (mask, bits, offset) | |||
| 10586 | *bits = nr; | 10586 | *bits = nr; |
| 10587 | } | 10587 | } |
| 10588 | 10588 | ||
| 10589 | /* Return 1 if display DISPLAY is available for use, 0 otherwise. | ||
| 10590 | But don't permanently open it, just test its availability. */ | ||
| 10591 | |||
| 10589 | int | 10592 | int |
| 10590 | x_display_ok (display) | 10593 | x_display_ok (display) |
| 10591 | const char * display; | 10594 | const char *display; |
| 10592 | { | 10595 | { |
| 10593 | int dpy_ok = 1; | 10596 | int dpy_ok = 1; |
| 10594 | Display *dpy; | 10597 | Display *dpy; |
| @@ -10601,6 +10604,10 @@ x_display_ok (display) | |||
| 10601 | return dpy_ok; | 10604 | return dpy_ok; |
| 10602 | } | 10605 | } |
| 10603 | 10606 | ||
| 10607 | /* Open a connection to X display DISPLAY_NAME, and return | ||
| 10608 | the structure that describes the open display. | ||
| 10609 | If we cannot contact the display, return null. */ | ||
| 10610 | |||
| 10604 | struct x_display_info * | 10611 | struct x_display_info * |
| 10605 | x_term_init (display_name, xrm_option, resource_name) | 10612 | x_term_init (display_name, xrm_option, resource_name) |
| 10606 | Lisp_Object display_name; | 10613 | Lisp_Object display_name; |
| @@ -10621,6 +10628,9 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10621 | ++x_initialized; | 10628 | ++x_initialized; |
| 10622 | } | 10629 | } |
| 10623 | 10630 | ||
| 10631 | if (! x_display_ok (SDATA (display_name))) | ||
| 10632 | error ("Display %s can't be opened", SDATA (display_name)); | ||
| 10633 | |||
| 10624 | #ifdef USE_GTK | 10634 | #ifdef USE_GTK |
| 10625 | { | 10635 | { |
| 10626 | #define NUM_ARGV 10 | 10636 | #define NUM_ARGV 10 |