Commit 4d2e7e17 authored by Jan D's avatar Jan D

Fixes: debbugs:19175

* gtkutil.c (xg_display_open):
* xterm.c (x_display_ok, x_term_init): Block SIGIO when opening
a display.
parent 2e0cfccd
2015-03-29 Jan Djärv <jan.h.d@swipnet.se>
* gtkutil.c (xg_display_open):
* xterm.c (x_display_ok, x_term_init): Block SIGIO when opening
a display (Bug#19175).
2015-04-01 Nicolas Petton <nicolas@petton.fr>
* Version 24.5 released.
......
......@@ -167,7 +167,9 @@ xg_display_open (char *display_name, Display **dpy)
{
GdkDisplay *gdpy;
unrequest_sigio (); // See comment in x_display_ok, xterm.c.
gdpy = gdk_display_open (display_name);
request_sigio ();
if (!gdpy_def && gdpy)
{
gdpy_def = gdpy;
......
......@@ -9719,7 +9719,11 @@ get_bits_and_offset (unsigned long mask, int *bits, int *offset)
bool
x_display_ok (const char *display)
{
Display *dpy = XOpenDisplay (display);
Display *dpy;
// XOpenDisplay fails if it gets a signal. Block SIGIO which may arrive.
unrequest_sigio ();
dpy = XOpenDisplay (display);
request_sigio ();
return dpy ? (XCloseDisplay (dpy), 1) : 0;
}
......@@ -9811,7 +9815,9 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
/* gtk_init does set_locale. Fix locale before and after. */
fixup_locale ();
unrequest_sigio (); // See comment in x_display_ok.
gtk_init (&argc, &argv2);
request_sigio ();
fixup_locale ();
g_log_remove_handler ("GLib", id);
......@@ -9861,10 +9867,12 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
argv[argc++] = xrm_option;
}
turn_on_atimers (0);
unrequest_sigio (); // See comment in x_display_ok.
dpy = XtOpenDisplay (Xt_app_con, SSDATA (display_name),
resource_name, EMACS_CLASS,
emacs_options, XtNumber (emacs_options),
&argc, argv);
request_sigio ();
turn_on_atimers (1);
#ifdef HAVE_X11XTR6
......@@ -9875,7 +9883,9 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
#else /* not USE_X_TOOLKIT */
XSetLocaleModifiers ("");
unrequest_sigio (); // See comment in x_display_ok.
dpy = XOpenDisplay (SSDATA (display_name));
request_sigio ();
#endif /* not USE_X_TOOLKIT */
#endif /* not USE_GTK*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment