3 #include <X11/extensions/shape.h>
4 /*#include <GL/glx.h>*/
10 static int x_error_handler(Display * disp, XErrorEvent * error)
13 XGetErrorText(disp, error->error_code, buf, 1024);
33 int h = 500, w = 500, tmp;
37 ob_display = XOpenDisplay(NULL);
38 XSetErrorHandler(x_error_handler);
39 ob_screen = DefaultScreen(ob_display);
40 ob_root = RootWindow(ob_display, ob_screen);
42 XCreateWindow(ob_display, RootWindow(ob_display, 0)
44 CopyFromParent, /* depth */
45 CopyFromParent, /* class */
46 CopyFromParent, /* visual */
49 XMapWindow(ob_display, win);
50 XSelectInput(ob_display, win, ExposureMask | StructureNotifyMask);
51 root = RootWindow (ob_display, DefaultScreen (ob_display));
54 look = appearance_new(Surface_Planar, 0);
55 look->surface.data.planar.grad = Background_Solid;
56 look->surface.data.planar.secondary = color_new(0xFF, 0xFF, 0xFF);
57 look->surface.data.planar.primary = color_parse("Red");
58 look->surface.data.planar.interlaced = FALSE;
61 look->area.width = 500;
62 look->area.height = 500;
63 if (ob_display == NULL) {
64 fprintf(stderr, "couldn't connect to X server :0\n");
70 XNextEvent(ob_display, &report);
71 switch (report.type) {
75 look->area.width = report.xconfigure.width;
76 look->area.height = report.xconfigure.height;
78 printf("confignotify %i:%i\n", w, h);