|
@@ -210,9 +210,27 @@ SYSWINDOW la_CreateWindowX11(int x, int y, int w, int h, char *title, int SyncTo
|
|
|
int sync=SyncToVBlank?1:0; glXSwapIntervalEXTF(MAIN.dpy, win, sync);
|
|
|
#endif
|
|
|
|
|
|
+ XSetLocaleModifiers("");
|
|
|
MAIN.im = XOpenIM(MAIN.dpy, NULL, NULL, NULL);
|
|
|
- MAIN.ic = XCreateIC(MAIN.im, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, XNClientWindow, win, NULL);
|
|
|
- XSetICFocus(MAIN.ic);
|
|
|
+ if(!MAIN.im){
|
|
|
+ XSetLocaleModifiers("@im=local");
|
|
|
+ MAIN.im = XOpenIM(MAIN.dpy, NULL, NULL, NULL);
|
|
|
+ }
|
|
|
+ if(!MAIN.im){
|
|
|
+ XSetLocaleModifiers("@im=none");
|
|
|
+ MAIN.im = XOpenIM(MAIN.dpy, NULL, NULL, NULL);
|
|
|
+ }
|
|
|
+ if(!MAIN.im){
|
|
|
+ XSetLocaleModifiers("@im=");
|
|
|
+ MAIN.im = XOpenIM(MAIN.dpy, NULL, NULL, NULL);
|
|
|
+ }
|
|
|
+ if(!MAIN.im){
|
|
|
+ logPrint("Can't open a input method.\n");
|
|
|
+ }
|
|
|
+ if(MAIN.im){
|
|
|
+ MAIN.ic = XCreateIC(MAIN.im, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, XNClientWindow, win, NULL);
|
|
|
+ XSetICFocus(MAIN.ic);
|
|
|
+ }
|
|
|
|
|
|
XClassHint ch; ch.res_name = "LAGUI_WINDOW"; ch.res_class = "LAGUI_WINDOW";
|
|
|
XSetClassHint(MAIN.dpy, win, &ch);
|
|
@@ -865,7 +883,6 @@ int laGetReadyWith(laInitArguments* ia){
|
|
|
logPrintNew("Initializing LaGUI...\n");
|
|
|
|
|
|
setlocale(LC_CTYPE, "zh_CN.utf8");
|
|
|
- XSetLocaleModifiers("");
|
|
|
|
|
|
XSetErrorHandler(la_XErrorHandler);
|
|
|
|