diff options
| author | Christoph Lohmann <20h@r-36.net> | 2012-12-11 08:32:08 +0100 |
|---|---|---|
| committer | Christoph Lohmann <20h@r-36.net> | 2012-12-11 08:32:08 +0100 |
| commit | 3c6ec1995d8ec4d8d5da7ca81d15adfdb08086aa (patch) | |
| tree | e9370a7bbc86160d0a25768d8f35dccf11147f2e | |
| parent | Be careful about mar77i's patches. (diff) | |
| download | st-3c6ec1995d8ec4d8d5da7ca81d15adfdb08086aa.tar.gz st-3c6ec1995d8ec4d8d5da7ca81d15adfdb08086aa.zip | |
Adding error checks for XCreateIC and XOpenIM.
| -rw-r--r-- | TODO | 1 | ||||
| -rw-r--r-- | st.c | 4 |
2 files changed, 4 insertions, 1 deletions
| @@ -17,7 +17,6 @@ code & interface | |||
| 17 | bugs | 17 | bugs |
| 18 | ---- | 18 | ---- |
| 19 | 19 | ||
| 20 | * handle XOpenMI() errors | ||
| 21 | * fix shift up/down (shift selection in emacs) | 20 | * fix shift up/down (shift selection in emacs) |
| 22 | * fix selection paste for xatom STRING | 21 | * fix selection paste for xatom STRING |
| 23 | * fix umlaut handling in settitle | 22 | * fix umlaut handling in settitle |
| @@ -2431,9 +2431,13 @@ xinit(void) { | |||
| 2431 | 2431 | ||
| 2432 | /* input methods */ | 2432 | /* input methods */ |
| 2433 | xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL); | 2433 | xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL); |
| 2434 | if(xw.xim == NULL) | ||
| 2435 | die("XOpenIM failed. Could not open input device.\n"); | ||
| 2434 | xw.xic = XCreateIC(xw.xim, XNInputStyle, XIMPreeditNothing | 2436 | xw.xic = XCreateIC(xw.xim, XNInputStyle, XIMPreeditNothing |
| 2435 | | XIMStatusNothing, XNClientWindow, xw.win, | 2437 | | XIMStatusNothing, XNClientWindow, xw.win, |
| 2436 | XNFocusWindow, xw.win, NULL); | 2438 | XNFocusWindow, xw.win, NULL); |
| 2439 | if(xw.xic == NULL) | ||
| 2440 | die("XCreateIC failed. Could not obtain input method.\n"); | ||
| 2437 | 2441 | ||
| 2438 | /* white cursor, black outline */ | 2442 | /* white cursor, black outline */ |
| 2439 | cursor = XCreateFontCursor(xw.dpy, XC_xterm); | 2443 | cursor = XCreateFontCursor(xw.dpy, XC_xterm); |
