Display *dpy;
Colourmap cmap;
Window win;
- XdbeBackBuffer buf;
+ Drawable buf;
Atom xembed, wmdeletewin;
XIM xim;
XIC xic;
static char *opt_class = NULL;
static char *opt_font = NULL;
+bool usedbe = False;
+
static char *usedfont = NULL;
static int usedfontsize = 0;
| ButtonMotionMask | ButtonPressMask | ButtonReleaseMask;
attrs.colormap = xw.cmap;
- parent = opt_embed ? strtol(opt_embed, NULL, 0) : XRootWindow(xw.dpy, xw.scr);
+ parent = opt_embed ? strtol(opt_embed, NULL, 0) : \
+ XRootWindow(xw.dpy, xw.scr);
xw.win = XCreateWindow(xw.dpy, parent, xw.fx, xw.fy,
xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
xw.vis,
&attrs);
/* double buffering */
- if(!XdbeQueryExtension(xw.dpy, &major, &minor))
- die("Xdbe extension is not present\n");
- xw.buf = XdbeAllocateBackBufferName(xw.dpy, xw.win, XdbeBackground);
+ if(XdbeQueryExtension(xw.dpy, &major, &minor)) {
+ xw.buf = XdbeAllocateBackBufferName(xw.dpy, xw.win,
+ XdbeBackground);
+ usedbe = True;
+ } else {
+ xw.buf = xw.win;
+ }
/* Xft rendering context */
- xw.draw = XftDrawCreate(xw.dpy, xw.buf, xw.vis, xw.cmap);
+ xw.draw = XftDrawCreate(xw.dpy, xw.win, xw.vis, xw.cmap);
/* input methods */
if((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) {
XdbeSwapInfo swpinfo[1] = {{xw.win, XdbeCopied}};
drawregion(0, 0, term.col, term.row);
- XdbeSwapBuffers(xw.dpy, swpinfo, 1);
+ if(usedbe)
+ XdbeSwapBuffers(xw.dpy, swpinfo, 1);
}
void