commit - 99de33395126fc9708f442d155e737b9182f6ef4
commit + 2cb539142b97bd2a5c1a322fd7c063c6afb67c9b
blob - 60eeee18ccfd0574f65fafdb055f239af6d2173a
blob + 5af6e4ddbb5c9e57d3b8e591e7e7c270b7ecba66
--- x.c
+++ x.c
struct {
XIM xim;
XIC xic;
+ XPoint spot;
+ XVaNestedList spotlist;
} ime;
Draw draw;
Visual *vis;
XNClientWindow, xw.win, XNFocusWindow, xw.win, NULL);
if (xw.xic == NULL)
die("XCreateIC failed. Could not obtain input method.\n");
+
+ xw.ime.spotlist = XVaCreateNestedList(0, XNSpotLocation, &xw.ime.spot,
+ NULL);
}
void
xw.ime.xim = NULL;
XRegisterIMInstantiateCallback(xw.dpy, NULL, NULL, NULL,
ximinstantiate, NULL);
+ XFree(xw.ime.spotlist);
}
void
void
xximspot(int x, int y)
{
- XPoint spot = { borderpx + x * win.cw, borderpx + (y + 1) * win.ch };
- XVaNestedList attr = XVaCreateNestedList(0, XNSpotLocation, &spot, NULL);
+ if (xw.ime.xic == NULL)
+ return;
- XSetICValues(xw.xic, XNPreeditAttributes, attr, NULL);
- XFree(attr);
+ xw.ime.spot.x = borderpx + x * win.cw;
+ xw.ime.spot.y = borderpx + (y + 1) * win.ch;
+
+ XSetICValues(xw.ime.xic, XNPreeditAttributes, xw.ime.spotlist, NULL);
}
void