Xinqi Bao's Git
projects
/
st.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
Call XdbeQueryExtension before of calling any Xdbe function
[st.git]
/
st.c
diff --git
a/st.c
b/st.c
index
2e1ac67
..
b013bca
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-1970,7
+1970,7
@@
xinit(void) {
XSetWindowAttributes attrs;
Cursor cursor;
Window parent;
XSetWindowAttributes attrs;
Cursor cursor;
Window parent;
- int sw, sh;
+ int sw, sh
, major, minor
;
if(!(xw.dpy = XOpenDisplay(NULL)))
die("Can't open display\n");
if(!(xw.dpy = XOpenDisplay(NULL)))
die("Can't open display\n");
@@
-2021,9
+2021,10
@@
xinit(void) {
CWBackPixel | CWBorderPixel | CWBitGravity | CWEventMask
| CWColormap,
&attrs);
CWBackPixel | CWBorderPixel | CWBitGravity | CWEventMask
| CWColormap,
&attrs);
+ if(!XdbeQueryExtension(xw.dpy, &major, &minor))
+ die("Xdbe extension is not present\n");
xw.buf = XdbeAllocateBackBufferName(xw.dpy, xw.win, XdbeCopied);
xw.buf = XdbeAllocateBackBufferName(xw.dpy, xw.win, XdbeCopied);
-
/* input methods */
xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL);
xw.xic = XCreateIC(xw.xim, XNInputStyle, XIMPreeditNothing
/* input methods */
xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL);
xw.xic = XCreateIC(xw.xim, XNInputStyle, XIMPreeditNothing