~petersanchez/st

4e14a4a97f7f7ef134fdc25d2fa34c8db7bb6e6c — Christoph Lohmann 11 years ago c99db5b
A fix for the XopenIM() errors.
1 files changed, 11 insertions(+), 3 deletions(-)

M st.c
M st.c => st.c +11 -3
@@ 2503,9 2503,17 @@ xinit(void) {
	xw.draw = XftDrawCreate(xw.dpy, xw.buf, xw.vis, xw.cmap);

	/* input methods */
	xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL);
	if(xw.xim == NULL)
		die("XOpenIM failed. Could not open input device.\n");
	if((xw.xim =  XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) {
		XSetLocaleModifiers("@im=local");
		if((xw.xim =  XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) {
			XSetLocaleModifiers("@im=");
			if((xw.xim = XOpenIM(xw.dpy,
					NULL, NULL, NULL)) == 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);