1
Index: fcitx/src/frontend/ipc/ipc.c
2
===================================================================
3
--- fcitx.orig/src/frontend/ipc/ipc.c 2012-09-26 22:01:16.354865405 +0800
4
+++ fcitx/src/frontend/ipc/ipc.c 2012-09-26 22:02:26.979215609 +0800
9
+ boolean lastPreeditIsEmpty;
12
typedef struct _FcitxIPCFrontend {
15
ipcic->id = ipc->maxid;
17
+ ipcic->lastPreeditIsEmpty = false;
18
sprintf(ipcic->path, FCITX_IC_DBUS_PATH, ipcic->id);
20
uint32_t arg1, arg2, arg3, arg4;
23
void IPCUpdatePreedit(void* arg, FcitxInputContext* ic)
25
+ FcitxIPCFrontend* ipc = (FcitxIPCFrontend*) arg;
26
+ FcitxInputState* input = FcitxInstanceGetInputState(ipc->owner);
27
+ FcitxMessages* clientPreedit = FcitxInputStateGetClientPreedit(input);
29
+ for (i = 0; i < FcitxMessagesGetMessageCount(clientPreedit) ; i ++) {
30
+ char* str = FcitxMessagesGetMessageString(clientPreedit, i);
31
+ if (!fcitx_utf8_check_string(str))
35
+ /* a small optimization, don't need to update empty preedit */
36
+ FcitxIPCIC* ipcic = GetIPCIC(ic);
37
+ if (ipcic->lastPreeditIsEmpty && FcitxMessagesGetMessageCount(clientPreedit) == 0)
40
+ ipcic->lastPreeditIsEmpty = (FcitxMessagesGetMessageCount(clientPreedit) == 0);
42
if (ic->contextCaps & CAPACITY_FORMATTED_PREEDIT) {
43
FcitxIPCFrontend* ipc = (FcitxIPCFrontend*) arg;
44
dbus_uint32_t serial = 0; // unique number to associate replies with requests
45
Index: fcitx/data/script/fcitx-configtool
46
===================================================================
47
--- fcitx.orig/data/script/fcitx-configtool 2012-09-26 22:01:57.235068121 +0800
48
+++ fcitx/data/script/fcitx-configtool 2012-09-26 22:03:16.283460099 +0800
50
exec $command kcm_fcitx
58
Index: fcitx/src/frontend/gtk2/fcitximcontext.c
59
===================================================================
60
--- fcitx.orig/src/frontend/gtk2/fcitximcontext.c 2012-09-26 22:01:57.235068121 +0800
61
+++ fcitx/src/frontend/gtk2/fcitximcontext.c 2012-09-26 22:03:16.287460117 +0800
64
/* set_cursor_location_internal() will get origin from X server,
65
* it blocks UI. So delay it to idle callback. */
66
- g_idle_add_full(G_PRIORITY_DEFAULT_IDLE,
67
+ gdk_threads_add_idle_full(G_PRIORITY_DEFAULT_IDLE,
68
(GSourceFunc) _set_cursor_location_internal,
69
g_object_ref(fcitxcontext),
70
(GDestroyNotify) g_object_unref);
76
- g_signal_emit(context, _signal_preedit_changed_id, 0);
85
- g_signal_emit(context, _signal_preedit_changed_id, 0);
91
/* set_cursor_location_internal() will get origin from X server,
92
* it blocks UI. So delay it to idle callback. */
93
- g_idle_add_full(G_PRIORITY_DEFAULT_IDLE,
94
+ gdk_threads_add_idle_full(G_PRIORITY_DEFAULT_IDLE,
95
(GSourceFunc) _set_cursor_location_internal,
96
g_object_ref(fcitxcontext),
97
(GDestroyNotify) g_object_unref);