-- -- if ((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) { -- XSetLocaleModifiers("_AT_im=local"); -- if ((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) { -- XSetLocaleModifiers("_AT_im="); -- if ((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) -- die("XOpenIM failed. Could not open input device. "); -- } -- } -- if (XSetIMValues(xw.xim, XNDestroyCallback, &destroy, NULL) != NULL) -- die("XSetIMValues failed. Could not set input method value. "); -- 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. "); --} -- --void --ximinstantiate(Display *dpy, XPointer client, XPointer call) --{ -- ximopen(dpy); -- XUnregisterIMInstantiateCallback(xw.dpy, NULL, NULL, NULL, -- ximinstantiate, NULL); --} -- --void --ximdestroy(XIM xim, XPointer client, XPointer call) --{ -- xw.xim = NULL; -- XRegisterIMInstantiateCallback(xw.dpy, NULL, NULL, NULL, -- ximinstantiate, NULL); --} -- - void - xinit(int cols, int rows) - { -_AT_@ -1044,11 +1013,23 @@ xinit(int cols, int rows) +_AT_@ -1004,11 +1013,23 @@ xinit(int cols, int rows) Window parent; pid_t thispid = getpid(); XColor xmousefg, xmousebg; _AT_@ -194,7 +119,7 @@ index 865dacc..588dec3 100644 /* font */ if (!FcInit()) -_AT_@ -1058,7 +1039,7 @@ xinit(int cols, int rows) +_AT_@ -1018,7 +1039,7 @@ xinit(int cols, int rows) xloadfonts(usedfont, 0); /* colors */ _AT_@ -203,13 +128,7 @@ index 865dacc..588dec3 100644 xloadcols(); /* adjust fixed window geometry */ -_AT_@ -1073,24 +1054,20 @@ xinit(int cols, int rows) - xw.attrs.background_pixel = dc.col[defaultbg].pixel; - xw.attrs.border_pixel = dc.col[defaultbg].pixel; - xw.attrs.bit_gravity = NorthWestGravity; -- xw.attrs.event_mask = FocusChangeMask | KeyPressMask | KeyReleaseMask -+ xw.attrs.event_mask = FocusChangeMask | KeyPressMask - | ExposureMask | VisibilityChangeMask | StructureNotifyMask +_AT_@ -1038,19 +1059,15 @@ xinit(int cols, int rows) | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask; xw.attrs.colormap = xw.cmap; _AT_@ -232,48 +151,7 @@ index 865dacc..588dec3 100644 XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel); XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h); -_AT_@ -1101,7 +1078,22 @@ xinit(int cols, int rows) - xw.draw = XftDrawCreate(xw.dpy, xw.buf, xw.vis, xw.cmap); - - /* input methods */ -- ximopen(xw.dpy); -+ if ((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) { -+ XSetLocaleModifiers("_AT_im=local"); -+ if ((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) { -+ XSetLocaleModifiers("_AT_im="); -+ if ((xw.xim = XOpenIM(xw.dpy, -+ NULL, NULL, NULL)) == NULL) { -+ die("XOpenIM failed. Could not open input" -+ " device. "); -+ } -+ } -+ } -+ 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. "); - - /* white cursor, black outline */ - cursor = XCreateFontCursor(xw.dpy, mouseshape); -_AT_@ -1579,16 +1571,6 @@ xfinishdraw(void) - defaultfg : defaultbg].pixel); - } - --void --xximspot(int x, int y) --{ -- XPoint spot = { borderpx + x * win.cw, borderpx + (y + 1) * win.ch }; -- XVaNestedList attr = XVaCreateNestedList(0, XNSpotLocation, &spot, NULL); -- -- XSetICValues(xw.xic, XNPreeditAttributes, attr, NULL); -- XFree(attr); --} -- - void - expose(XEvent *ev) - { -_AT_@ -1929,6 +1911,9 @@ main(int argc, char *argv[]) +_AT_@ -1894,6 +1911,9 @@ main(int argc, char *argv[]) case 'a': allowaltscreen = 0; break;Received on Sun Feb 17 2019 - 05:49:23 CET
This archive was generated by hypermail 2.3.0 : Sun Feb 17 2019 - 06:00:31 CET