• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

A multilingual input method framework


Commit MetaInfo

Revisiona79acc17d5f259f56a2a835e23c159121d5f60fe (tree)
Time2006-06-29 12:42:07
Authorekato <ekato@ff9a...>
Commiterekato

Log Message

* emacs/helper.c
* emacs/uim-el-agent.c

- Port r3651:3652 from trunk.

Change Summary

Incremental Difference

--- a/emacs/helper.c
+++ b/emacs/helper.c
@@ -117,19 +117,19 @@ helper_send_im_list(void)
117117
118118
119119
120-static void
120+static int
121121 helper_im_changed(char *request, char *engine_name)
122122 {
123123
124124 debug_printf(DEBUG_NOTE, "helper_im_changed: %s\n", engine_name);
125125
126- if (strcmp(request, "im_change_this_text_area_only") == 0) {
126+ if (focused && strcmp(request, "im_change_this_text_area_only") == 0) {
127127
128128 if (current)
129129 switch_context_im(current, engine_name);
130130
131131 } else if (strcmp(request, "im_change_whole_desktop") == 0
132- || strcmp(request, "im_change_this_application_only") == 0) {
132+ || (focused && strcmp(request, "im_change_this_application_only") == 0)) {
133133
134134 /* change default */
135135 update_default_engine(engine_name);
@@ -137,7 +137,12 @@ helper_im_changed(char *request, char *engine_name)
137137 /* check focus state when change IM of current application */
138138 if (strcmp(request, "im_change_whole_desktop") == 0 || current)
139139 switch_context_im_all(engine_name);
140+ } else {
141+
142+ return 0;
140143 }
144+
145+ return 1;
141146 }
142147
143148
@@ -152,7 +157,7 @@ helper_handler(uim_agent_context *ua, char *helper_message)
152157
153158 debug_printf(DEBUG_NOTE, " message \"%s\"\n", message);
154159
155- if (strcmp("focus_in", message) == 0) {
160+ if (focused && strcmp("focus_in", message) == 0) {
156161
157162 /* some other window is focused */
158163
@@ -160,7 +165,7 @@ helper_handler(uim_agent_context *ua, char *helper_message)
160165
161166 focused = 0;
162167
163- } else if (strncmp("prop_activate", message, 13) == 0) {
168+ } else if (focused && strncmp("prop_activate", message, 13) == 0) {
164169
165170 debug_printf(DEBUG_NOTE, " prop_activate\n");
166171
@@ -176,7 +181,8 @@ helper_handler(uim_agent_context *ua, char *helper_message)
176181 }
177182 }
178183
179- } else if (strcmp("prop_list_get", message) == 0) {
184+
185+ } else if (focused && strcmp("prop_list_get", message) == 0) {
180186
181187 debug_printf(DEBUG_NOTE, " prop_list_get\n");
182188
@@ -190,16 +196,16 @@ helper_handler(uim_agent_context *ua, char *helper_message)
190196 if ((p = strchr(message, ' ')) != NULL) {
191197 *p = '\0';
192198 engine = p + 1;
193- helper_im_changed(message, engine);
199+ return helper_im_changed(message, engine);
194200 }
195201
196- } else if (strcmp("im_list_get", message) == 0) {
202+ } else if (focused && strcmp("im_list_get", message) == 0) {
197203
198204 debug_printf(DEBUG_NOTE, " im_list_get\n");
199205
200206 helper_send_im_list();
201207
202- } else if (strncmp("commit_string", message, 13) == 0) {
208+ } else if (focused && strncmp("commit_string", message, 13) == 0) {
203209
204210 char *encoding, *str;
205211
@@ -230,7 +236,7 @@ helper_handler(uim_agent_context *ua, char *helper_message)
230236 free(str);
231237
232238 }
233- }
239+ }
234240 }
235241
236242 } else if (strncmp("prop_update_custom", message, 18) == 0) {
@@ -263,6 +269,7 @@ helper_handler(uim_agent_context *ua, char *helper_message)
263269 } else {
264270
265271 debug_printf(DEBUG_WARNING, " undefined helper message: %s\n", message);
272+ return 0;
266273
267274 }
268275
--- a/emacs/uim-el-agent.c
+++ b/emacs/uim-el-agent.c
@@ -64,25 +64,23 @@ static int
6464 cmd_helper(int context_id, char *helper_message)
6565 {
6666 uim_agent_context *ua;
67+ int ret;
6768
68- if (focused) {
69- int ret;
70- ua = get_uim_agent_context(context_id);
71- ret = helper_handler(ua, helper_message);
69+ ua = get_uim_agent_context(context_id);
70+ ret = helper_handler(ua, helper_message);
7271
73- if (ua) {
74- show_commit_string_uim_agent_context(current);
75- show_preedit_uim_agent_context(ua);
76- show_candidate_uim_agent_context(ua);
72+ if (ua && ret) {
73+ show_commit_string_uim_agent_context(current);
74+ show_preedit_uim_agent_context(ua);
75+ show_candidate_uim_agent_context(ua);
7776
78- check_prop_list_update(ua);
79- check_default_engine();
80- }
77+ check_prop_list_update(ua);
78+ check_default_engine();
8179
82- return ret;
83- } else {
84- return 0;
80+ return ret;
8581 }
82+
83+ return 0;
8684 }
8785
8886