1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
--- src/input.c 2011/02/14 04:59:22 1.154
+++ src/input.c 2011/03/09 05:45:49 1.155
@@ -3004,9 +3004,6 @@
take_action_list (MInputContext *ic, MPlist *action_list)
{
MInputContextInfo *ic_info = (MInputContextInfo *) ic->info;
- MPlist *candidate_list = ic->candidate_list;
- int candidate_index = ic->candidate_index;
- int candidate_show = ic->candidate_show;
MTextProperty *prop;
MPLIST_DO (action_list, action_list)
@@ -3480,31 +3477,6 @@
};
}
}
-
- if (ic->candidate_list)
- {
- M17N_OBJECT_UNREF (ic->candidate_list);
- ic->candidate_list = NULL;
- }
- if (ic->cursor_pos > 0
- && (prop = mtext_get_property (ic->preedit, ic->cursor_pos - 1,
- Mcandidate_list)))
- {
- ic->candidate_list = mtext_property_value (prop);
- M17N_OBJECT_REF (ic->candidate_list);
- ic->candidate_index
- = (int) mtext_get_prop (ic->preedit, ic->cursor_pos - 1,
- Mcandidate_index);
- ic->candidate_from = mtext_property_start (prop);
- ic->candidate_to = mtext_property_end (prop);
- }
-
- if (candidate_list != ic->candidate_list)
- ic->candidates_changed |= MINPUT_CANDIDATES_LIST_CHANGED;
- if (candidate_index != ic->candidate_index)
- ic->candidates_changed |= MINPUT_CANDIDATES_INDEX_CHANGED;
- if (candidate_show != ic->candidate_show)
- ic->candidates_changed |= MINPUT_CANDIDATES_SHOW_CHANGED;
return 0;
}
@@ -3914,7 +3886,37 @@
ic_info->key_unhandled = 0;
do {
- if (handle_key (ic) < 0)
+ MPlist *candidate_list = ic->candidate_list;
+ int candidate_index = ic->candidate_index;
+ int candidate_show = ic->candidate_show;
+ MTextProperty *prop;
+ int result = handle_key (ic);
+
+ if (ic->candidate_list)
+ {
+ M17N_OBJECT_UNREF (ic->candidate_list);
+ ic->candidate_list = NULL;
+ }
+ if (ic->cursor_pos > 0
+ && (prop = mtext_get_property (ic->preedit, ic->cursor_pos - 1,
+ Mcandidate_list)))
+ {
+ ic->candidate_list = mtext_property_value (prop);
+ M17N_OBJECT_REF (ic->candidate_list);
+ ic->candidate_index
+ = (int) mtext_get_prop (ic->preedit, ic->cursor_pos - 1,
+ Mcandidate_index);
+ ic->candidate_from = mtext_property_start (prop);
+ ic->candidate_to = mtext_property_end (prop);
+ }
+ if (candidate_list != ic->candidate_list)
+ ic->candidates_changed |= MINPUT_CANDIDATES_LIST_CHANGED;
+ if (candidate_index != ic->candidate_index)
+ ic->candidates_changed |= MINPUT_CANDIDATES_INDEX_CHANGED;
+ if (candidate_show != ic->candidate_show)
+ ic->candidates_changed |= MINPUT_CANDIDATES_SHOW_CHANGED;
+
+ if (result < 0)
{
/* KEY was not handled. Delete it from the current key sequence. */
if (ic_info->used > 0)
|