/* initializing an X connection */
/************************************************************************/
+static struct device *device_being_initialized = NULL;
+
static void
allocate_x_device_struct (struct device *d)
{
*/
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)
Lisp_Object dev;
struct device *d = get_device_from_display_1 (disp);
+ if (!d)
+ d = device_being_initialized;
+
assert (d != NULL);
XSETDEVICE (dev, d);