+ xwindow = XCreateWindow(display, defaultRootWindow, sizeHints.x, sizeHints.y,
+ sizeHints.width, sizeHints.height, 2, screenDepth,
+ InputOutput, CopyFromParent, 0, 0);
+ if (xwindow == 0)
+ {
+ fprintf(stderr, "%s: \"%s\": %s: %s\n", progname,
+ XDisplayName(arg_display), "failed to open window",
+ strerror(errno));
+ return(1);
+ }
+
+ setWindowAttributes.background_pixel = screenBlackPixel;
+ setWindowAttributes.border_pixel = screenWhitePixel;
+ setWindowAttributes.backing_store = NotUseful;
+ setWindowAttributes.override_redirect = False;
+ setWindowAttributes.event_mask =
+ KeyPressMask | EnterWindowMask | LeaveWindowMask | ExposureMask;
+ setWindowAttributes.colormap =
+ privateColourmap ? privateColourmap : defaultColourmap;
+ XChangeWindowAttributes(display, xwindow,
+ CWBackPixel | CWBorderPixel | CWBackingStore |
+ CWOverrideRedirect | CWEventMask | CWColormap,
+ &setWindowAttributes);
+
+ XStoreName(display, xwindow, "Emerald Mine");
+
+ wmHints.flags = InputHint | StateHint;
+ wmHints.input = True;
+ wmHints.initial_state = NormalState;
+ XSetWMHints(display, xwindow, &wmHints);
+
+ XSetWMNormalHints(display, xwindow, &sizeHints);
+
+ deleteAtom = XInternAtom(display, "WM_DELETE_WINDOW", False);
+ XSetWMProtocols(display, xwindow, &deleteAtom, 1);
+
+ cursor = XCreateFontCursor(display, XC_trek);
+ if (cursor) XDefineCursor(display, xwindow, cursor);
+
+ XMapWindow(display, xwindow);