diff options
author | Christoph Lohmann <20h@r-36.net> | 2013-01-19 09:13:52 +0100 |
---|---|---|
committer | Christoph Lohmann <20h@r-36.net> | 2013-01-19 09:13:52 +0100 |
commit | 0e232a41150d67539df05e60c7e829f0bfb431d0 (patch) | |
tree | 0bc41f12a41e914b95210a1209d2c26a4d4af22d | |
parent | 3ce96aea8af566c88ed1e076d270b4d1abcf6e96 (diff) | |
download | st-patched-0e232a41150d67539df05e60c7e829f0bfb431d0.tar.bz2 st-patched-0e232a41150d67539df05e60c7e829f0bfb431d0.tar.xz st-patched-0e232a41150d67539df05e60c7e829f0bfb431d0.zip |
Dbe is not required anymore.
-rw-r--r-- | st.c | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -203,7 +203,7 @@ typedef struct { | |||
203 | Display *dpy; | 203 | Display *dpy; |
204 | Colourmap cmap; | 204 | Colourmap cmap; |
205 | Window win; | 205 | Window win; |
206 | XdbeBackBuffer buf; | 206 | Drawable buf; |
207 | Atom xembed, wmdeletewin; | 207 | Atom xembed, wmdeletewin; |
208 | XIM xim; | 208 | XIM xim; |
209 | XIC xic; | 209 | XIC xic; |
@@ -414,6 +414,8 @@ static char *opt_embed = NULL; | |||
414 | static char *opt_class = NULL; | 414 | static char *opt_class = NULL; |
415 | static char *opt_font = NULL; | 415 | static char *opt_font = NULL; |
416 | 416 | ||
417 | bool usedbe = False; | ||
418 | |||
417 | static char *usedfont = NULL; | 419 | static char *usedfont = NULL; |
418 | static int usedfontsize = 0; | 420 | static int usedfontsize = 0; |
419 | 421 | ||
@@ -2500,7 +2502,8 @@ xinit(void) { | |||
2500 | | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask; | 2502 | | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask; |
2501 | attrs.colormap = xw.cmap; | 2503 | attrs.colormap = xw.cmap; |
2502 | 2504 | ||
2503 | parent = opt_embed ? strtol(opt_embed, NULL, 0) : XRootWindow(xw.dpy, xw.scr); | 2505 | parent = opt_embed ? strtol(opt_embed, NULL, 0) : \ |
2506 | XRootWindow(xw.dpy, xw.scr); | ||
2504 | xw.win = XCreateWindow(xw.dpy, parent, xw.fx, xw.fy, | 2507 | xw.win = XCreateWindow(xw.dpy, parent, xw.fx, xw.fy, |
2505 | xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput, | 2508 | xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput, |
2506 | xw.vis, | 2509 | xw.vis, |
@@ -2509,12 +2512,16 @@ xinit(void) { | |||
2509 | &attrs); | 2512 | &attrs); |
2510 | 2513 | ||
2511 | /* double buffering */ | 2514 | /* double buffering */ |
2512 | if(!XdbeQueryExtension(xw.dpy, &major, &minor)) | 2515 | if(XdbeQueryExtension(xw.dpy, &major, &minor)) { |
2513 | die("Xdbe extension is not present\n"); | 2516 | xw.buf = XdbeAllocateBackBufferName(xw.dpy, xw.win, |
2514 | xw.buf = XdbeAllocateBackBufferName(xw.dpy, xw.win, XdbeBackground); | 2517 | XdbeBackground); |
2518 | usedbe = True; | ||
2519 | } else { | ||
2520 | xw.buf = xw.win; | ||
2521 | } | ||
2515 | 2522 | ||
2516 | /* Xft rendering context */ | 2523 | /* Xft rendering context */ |
2517 | xw.draw = XftDrawCreate(xw.dpy, xw.buf, xw.vis, xw.cmap); | 2524 | xw.draw = XftDrawCreate(xw.dpy, xw.win, xw.vis, xw.cmap); |
2518 | 2525 | ||
2519 | /* input methods */ | 2526 | /* input methods */ |
2520 | if((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) { | 2527 | if((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) { |
@@ -2822,7 +2829,8 @@ draw(void) { | |||
2822 | XdbeSwapInfo swpinfo[1] = {{xw.win, XdbeCopied}}; | 2829 | XdbeSwapInfo swpinfo[1] = {{xw.win, XdbeCopied}}; |
2823 | 2830 | ||
2824 | drawregion(0, 0, term.col, term.row); | 2831 | drawregion(0, 0, term.col, term.row); |
2825 | XdbeSwapBuffers(xw.dpy, swpinfo, 1); | 2832 | if(usedbe) |
2833 | XdbeSwapBuffers(xw.dpy, swpinfo, 1); | ||
2826 | } | 2834 | } |
2827 | 2835 | ||
2828 | void | 2836 | void |