Adding error checks for XCreateIC and XOpenIM.

dev
Christoph Lohmann 2012-12-11 08:32:08 +01:00
parent 2696f81875
commit 3c6ec1995d
2 changed files with 4 additions and 1 deletions

1
TODO
View File

@ -17,7 +17,6 @@ code & interface
bugs bugs
---- ----
* handle XOpenMI() errors
* fix shift up/down (shift selection in emacs) * fix shift up/down (shift selection in emacs)
* fix selection paste for xatom STRING * fix selection paste for xatom STRING
* fix umlaut handling in settitle * fix umlaut handling in settitle

4
st.c
View File

@ -2431,9 +2431,13 @@ xinit(void) {
/* input methods */ /* input methods */
xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL); xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL);
if(xw.xim == NULL)
die("XOpenIM failed. Could not open input device.\n");
xw.xic = XCreateIC(xw.xim, XNInputStyle, XIMPreeditNothing xw.xic = XCreateIC(xw.xim, XNInputStyle, XIMPreeditNothing
| XIMStatusNothing, XNClientWindow, xw.win, | XIMStatusNothing, XNClientWindow, xw.win,
XNFocusWindow, xw.win, NULL); XNFocusWindow, xw.win, NULL);
if(xw.xic == NULL)
die("XCreateIC failed. Could not obtain input method.\n");
/* white cursor, black outline */ /* white cursor, black outline */
cursor = XCreateFontCursor(xw.dpy, XC_xterm); cursor = XCreateFontCursor(xw.dpy, XC_xterm);