diff options
| author | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2012-09-16 10:45:36 +0200 |
|---|---|---|
| committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2012-09-16 10:45:36 +0200 |
| commit | ba1e9daeef0d7e6e52a9889d8f7eb61d74480cf0 (patch) | |
| tree | 090a001bd194e92f625005a9ea854358ff77085e /st.c | |
| parent | Implementing italic-bold. This will require an increase of the avgWdth. (diff) | |
| download | st-ba1e9daeef0d7e6e52a9889d8f7eb61d74480cf0.tar.gz st-ba1e9daeef0d7e6e52a9889d8f7eb61d74480cf0.zip | |
Call XdbeQueryExtension before of calling any Xdbe function
XdbeQueryExtension() tells to the caller if the Xdbe extension is present in
the X server, so it should be called for sanity. But like is said in
XdbeQueryExtension(3):
No other Xdbe functions may be called before this function. If a
client violates this rule, the effects of all subsequent Xdbe calls
that it makes are undefined.
it is mandatory call this function.
---
st.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Diffstat (limited to '')
| -rw-r--r-- | st.c | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -1970,7 +1970,7 @@ xinit(void) { | |||
| 1970 | XSetWindowAttributes attrs; | 1970 | XSetWindowAttributes attrs; |
| 1971 | Cursor cursor; | 1971 | Cursor cursor; |
| 1972 | Window parent; | 1972 | Window parent; |
| 1973 | int sw, sh; | 1973 | int sw, sh, major, minor; |
| 1974 | 1974 | ||
| 1975 | if(!(xw.dpy = XOpenDisplay(NULL))) | 1975 | if(!(xw.dpy = XOpenDisplay(NULL))) |
| 1976 | die("Can't open display\n"); | 1976 | die("Can't open display\n"); |
| @@ -2021,9 +2021,10 @@ xinit(void) { | |||
| 2021 | CWBackPixel | CWBorderPixel | CWBitGravity | CWEventMask | 2021 | CWBackPixel | CWBorderPixel | CWBitGravity | CWEventMask |
| 2022 | | CWColormap, | 2022 | | CWColormap, |
| 2023 | &attrs); | 2023 | &attrs); |
| 2024 | if(!XdbeQueryExtension(xw.dpy, &major, &minor)) | ||
| 2025 | die("Xdbe extension is not present\n"); | ||
| 2024 | xw.buf = XdbeAllocateBackBufferName(xw.dpy, xw.win, XdbeCopied); | 2026 | xw.buf = XdbeAllocateBackBufferName(xw.dpy, xw.win, XdbeCopied); |
| 2025 | 2027 | ||
| 2026 | |||
| 2027 | /* input methods */ | 2028 | /* input methods */ |
| 2028 | xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL); | 2029 | xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL); |
| 2029 | xw.xic = XCreateIC(xw.xim, XNInputStyle, XIMPreeditNothing | 2030 | xw.xic = XCreateIC(xw.xim, XNInputStyle, XIMPreeditNothing |
