|

楼主 |
发表于 2007-11-9 08:45:53
|
显示全部楼层
这个bug Yuking曾经修正过,不过我发现现在又重现了,因为Yuking放弃fcitx开发了,我就自己试着写了个patch,还有那个iIMCount += 4我看不出有什么必要,就去掉了。
with fcitx-3.5-20070713- diff -Naur fcitx-3.5/src/ime.c fcitx-3.5-new/src/ime.c
- --- fcitx-3.5/src/ime.c 2007-07-05 20:57:16.000000000 +0800
- +++ fcitx-3.5-new/src/ime.c 2007-11-09 08:26:12.000000000 +0800
- @@ -1035,16 +1035,21 @@
- DrawMainWindow ();
- - if (iIMCount == 1)
- + if (iIMCount == 1 && im[iIMIndex].ACTIVE_D)
- return;
- if (index != (INT8) - 2) {
- if (im[iLastIM].Destroy)
- im[iLastIM].Destroy ();
- + im[iLastIM].ACTIVE_D = False;
- if (im[iIMIndex].Init)
- im[iIMIndex].Init ();
- + im[iIMIndex].ACTIVE_D = True;
- }
- + if (iIMCount == 1)
- + return;
- +
- ResetInput ();
- XUnmapWindow (dpy, inputWindow);
- @@ -1077,6 +1082,7 @@
- im[iIMCount].PhraseTips = PhraseTips;
- im[iIMCount].Init = Init;
- im[iIMCount].Destroy = Destroy;
- + im[iIMCount].ACTIVE_D = False;
- iIMCount++;
- }
- @@ -1121,9 +1127,10 @@
- if (!iIMCount)
- iIMCount = 1;
- - iIMCount += 4;
- +/* iIMCount += 4; for what? */
- im = (IM *) malloc (sizeof (IM) * iIMCount);
- + memset(im, 0, sizeof(IM) * iIMCount);
- iIMCount = 0;
- /*
- diff -Naur fcitx-3.5/src/ime.h fcitx-3.5-new/src/ime.h
- --- fcitx-3.5/src/ime.h 2007-05-28 12:18:59.000000000 +0800
- +++ fcitx-3.5-new/src/ime.h 2007-11-09 08:21:11.000000000 +0800
- @@ -97,6 +97,7 @@
- Bool (*PhraseTips) (void);
- void (*Init) (void);
- void (*Destroy) (void);
- + Bool ACTIVE_D;
- } IM;
- typedef int HOTKEYS;
复制代码 因为我只是看了部分fcitx的源码,因此这个patch可能问题多多。 |
|