X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=src%2Fdevice-x.c;h=4bfa4b0eb77bd9e6e0315fa3eb89963b6bd1dbbe;hp=a6fc1bc64c8b27854562f9f55931baea3aa6edea;hb=d8654f7c5ad0c04060008c6fbbd90add1f4537e3;hpb=caf1416adb403b6334ce635e58b269b6c653aa39 diff --git a/src/device-x.c b/src/device-x.c index a6fc1bc..4bfa4b0 100644 --- a/src/device-x.c +++ b/src/device-x.c @@ -168,6 +168,8 @@ get_x_display (Lisp_Object device) /* initializing an X connection */ /************************************************************************/ +static struct device *device_being_initialized = NULL; + static void allocate_x_device_struct (struct device *d) { @@ -562,7 +564,9 @@ x_init_device (struct device *d, Lisp_Object props) */ slow_down_interrupts (); /* May not be needed but XtOpenDisplay could not deal with signals here. */ + device_being_initialized = d; dpy = DEVICE_X_DISPLAY (d) = XOpenDisplay (disp_name); + device_being_initialized = NULL; speed_up_interrupts (); if (dpy == 0) @@ -1116,6 +1120,9 @@ x_IO_error_handler (Display *disp) Lisp_Object dev; struct device *d = get_device_from_display_1 (disp); + if (!d) + d = device_being_initialized; + assert (d != NULL); XSETDEVICE (dev, d);