(STRINGP (Vinvocation_name) ?
(char *) XSTRING_DATA (Vinvocation_name) : FALLBACK_RESOURCE_NAME),
DisplayString (dpy) ? DisplayString (dpy) : "???");
- abort();
+ ABORT();
}
#undef FALLBACK_RESOURCE_NAME
/* initializing an X connection */
/************************************************************************/
+static struct device *device_being_initialized = NULL;
+
static void
allocate_x_device_struct (struct device *d)
{
vi_in.visualid = XVisualIDFromVisual (visual);
vi_out = XGetVisualInfo (dpy, /*VisualScreenMask|*/VisualIDMask,
&vi_in, &out_count);
- if (! vi_out) abort ();
+ if (! vi_out) ABORT ();
d = vi_out [0].depth;
XFree ((char *) vi_out);
return 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)
}
#endif /* EXTERNAL_WIDGET */
+#if 0
+ /* This ends up calling X, which isn't allowed in an X error handler
+ */
stderr_out ("\n%s: ",
(STRINGP (Vinvocation_name)
? (char *) XSTRING_DATA (Vinvocation_name)
: "xemacs"));
+#endif
XmuPrintDefaultErrorMessage (disp, event, stderr);
}
return 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);
Xlib might just decide to exit(). So we mark the offending
console for deletion and throw to top level. */
if (d)
- enqueue_magic_eval_event (io_error_delete_device, dev);
- DEVICE_X_BEING_DELETED (d) = 1;
+ {
+ enqueue_magic_eval_event (io_error_delete_device, dev);
+ DEVICE_X_BEING_DELETED (d) = 1;
+ }
Fthrow (Qtop_level, Qnil);
return 0; /* not reached */