Added an error message if the display can't be opened

This commit is contained in:
Alastair Hughes 2016-04-23 07:54:05 +12:00
parent bc8db2e3f3
commit a0710d941f

View File

@ -87,6 +87,8 @@ main(void)
/* X11 */
memset(&xw, 0, sizeof xw);
xw.dpy = XOpenDisplay(NULL);
if (!xw.dpy) die("Could not open a display; perhaps $DISPLAY is not set?");
xw.root = DefaultRootWindow(xw.dpy);
xw.screen = XDefaultScreen(xw.dpy);
xw.vis = XDefaultVisual(xw.dpy, xw.screen);