3 #include <X11/extensions/shape.h>
9 static int x_error_handler(Display * disp, XErrorEvent * error)
12 XGetErrorText(disp, error->error_code, buf, 1024);
30 ob_display = XOpenDisplay(NULL);
31 XSetErrorHandler(x_error_handler);
32 ob_screen = DefaultScreen(ob_display);
33 ob_root = RootWindow(ob_display, ob_screen);
35 XCreateWindow(ob_display, RootWindow(ob_display, 0),
37 CopyFromParent, /* depth */
38 CopyFromParent, /* class */
39 CopyFromParent, /* visual */
42 XMapWindow(ob_display, win);
43 XSelectInput(ob_display, win, ExposureMask | StructureNotifyMask);
44 root = RootWindow (ob_display, DefaultScreen (ob_display));
47 look = appearance_new(0);
48 look->surface.grad = Background_Pyramid;
49 look->surface.secondary = color_parse("Yellow");
50 look->surface.primary = color_parse("Blue");
51 look->surface.interlaced = FALSE;
52 if (ob_display == NULL) {
53 fprintf(stderr, "couldn't connect to X server :0\n");
57 paint(win, look, w, h);
59 XNextEvent(ob_display, &report);
60 switch (report.type) {
65 report.xconfigure.width,
66 report.xconfigure.height);