]>
Dogcows Code - chaz/openbox/blob - render/test.c
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
;
59 if (ob_display
== NULL
) {
60 fprintf(stderr
, "couldn't connect to X server :0\n");
64 paint(win
, look
, 0, 0, 500, 500);
66 XNextEvent(ob_display
, &report
);
67 switch (report
.type
) {
71 w
= report
.xconfigure
.width
;
72 h
= report
.xconfigure
.height
;
73 paint(win
, look
, 0, 0, w
, h
);
74 printf("confignotify %i:%i\n", w
, h
);
This page took 0.03999 seconds and 4 git commands to generate.