diff --git a/src/backend/x11.c b/src/backend/x11.c index 0008dda..9ed23ab 100644 --- a/src/backend/x11.c +++ b/src/backend/x11.c @@ -38,6 +38,20 @@ MwLL MwLLCreate(MwLL parent, int x, int y, int width, int height) { p = parent->window; } r->window = XCreateSimpleWindow(r->display, p, x, y, width, height, 0, 0, WhitePixel(r->display, XDefaultScreen(r->display))); + + XSetLocaleModifiers(""); + if((r->xim = XOpenIM(r->display, 0, 0, 0)) == NULL){ + XSetLocaleModifiers("@im=none"); + r->xim = XOpenIM(r->display, 0, 0, 0); + } + + r->xic = XCreateIC(r->xim, + XNInputStyle, XIMPreeditNothing | XIMStatusNothing, + XNClientWindow, r->window, + XNFocusWindow, r->window, + NULL); + XSetICFocus(r->xic); + r->copy_buffer = 1; r->width = width; @@ -62,6 +76,9 @@ MwLL MwLLCreate(MwLL parent, int x, int y, int width, int height) { void MwLLDestroy(MwLL handle) { MwLLDestroyCommon(handle); + XDestroyIC(handle->xic); + XCloseIM(handle->xim); + destroy_pixmap(handle); XFreeGC(handle->display, handle->gc); XDestroyWindow(handle->display, handle->window); diff --git a/src/backend/x11.h b/src/backend/x11.h index d6eba6e..c18f1c3 100644 --- a/src/backend/x11.h +++ b/src/backend/x11.h @@ -21,6 +21,8 @@ struct _MwLL { void* user; Atom wm_delete; int copy_buffer; + XIM xim; + XIC xic; unsigned int width; unsigned int height;