Xinqi Bao's Git
projects
/
st.git
/ commitdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
2696f81
)
Adding error checks for XCreateIC and XOpenIM.
author
Christoph Lohmann <
[email protected]
>
Tue, 11 Dec 2012 07:32:08 +0000
(08:32 +0100)
committer
Christoph Lohmann <
[email protected]
>
Tue, 11 Dec 2012 07:32:08 +0000
(08:32 +0100)
TODO
patch
|
blob
|
history
st.c
patch
|
blob
|
history
diff --git
a/TODO
b/TODO
index
b1af774
..
a4cfeee
100644
(file)
--- a/
TODO
+++ b/
TODO
@@
-17,7
+17,6
@@
code & interface
bugs
----
bugs
----
-* handle XOpenMI() errors
* fix shift up/down (shift selection in emacs)
* fix selection paste for xatom STRING
* fix umlaut handling in settitle
* fix shift up/down (shift selection in emacs)
* fix selection paste for xatom STRING
* fix umlaut handling in settitle
diff --git
a/st.c
b/st.c
index
42061b9
..
da5f78d
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-2431,9
+2431,13
@@
xinit(void) {
/* input methods */
xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL);
/* input methods */
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
| XIMStatusNothing, XNClientWindow, xw.win,
XNFocusWindow, xw.win, NULL);
xw.xic = XCreateIC(xw.xim, XNInputStyle, XIMPreeditNothing
| XIMStatusNothing, XNClientWindow, xw.win,
XNFocusWindow, xw.win, NULL);
+ if(xw.xic == NULL)
+ die("XCreateIC failed. Could not obtain input method.\n");
/* white cursor, black outline */
cursor = XCreateFontCursor(xw.dpy, XC_xterm);
/* white cursor, black outline */
cursor = XCreateFontCursor(xw.dpy, XC_xterm);