aboutsummaryrefslogtreecommitdiff
path: root/system/mlterm/mlterm-3.3.3-fixes.patch
blob: 3e9719f12dc01436fd851749a2b3dc804f831687 (plain)
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
diff -r ac6ec6344d05 inputmethod/uim/im_uim.c
--- a/inputmethod/uim/im_uim.c
+++ b/inputmethod/uim/im_uim.c
@@ -78,6 +78,8 @@
 
 	u_int  cand_limit ;
 
+	int  is_mozc ;
+
 }  im_uim_t ;
 
 KIK_LIST_TYPEDEF( im_uim_t) ;
@@ -744,13 +746,13 @@
 
 	uim = (im_uim_t*) p ;
 
+	(*uim->im.listener->get_spot)( uim->im.listener->self ,
+				       uim->im.preedit.chars ,
+				       uim->im.preedit.segment_offset ,
+				       &x , &y) ;
+
 	if( uim->im.cand_screen == NULL)
 	{
-		(*uim->im.listener->get_spot)( uim->im.listener->self ,
-					       uim->im.preedit.chars ,
-					       uim->im.preedit.segment_offset ,
-					       &x , &y) ;
-
 		if( ! ( uim->im.cand_screen = (*syms->x_im_candidate_screen_new)(
 				uim->im.disp , uim->im.font_man , uim->im.color_man ,
 				(*uim->im.listener->is_vertical)(uim->im.listener->self) ,
@@ -847,6 +852,22 @@
 
 	if( uim->im.cand_screen)
 	{
+		/*
+		 * XXX Hack for uim-mozc (1.11.1522.102)
+		 * If candidate_activate() is called with num == 20 and limit = 10,
+		 * uim_get_candidate() on mozc doesn't returns 20 candidates but 10 ones.
+		 * (e.g. uim_get_candidate(0) and uim_get_candidate(10) returns the same.)
+		 */
+		if( uim->is_mozc &&
+		    uim->im.cand_screen->index != index &&
+		    uim->im.cand_screen->index / uim->cand_limit != index / uim->cand_limit &&
+		    (index % uim->cand_limit) == 0)
+		{
+			candidate_activate( p ,
+				uim->im.cand_screen->num_of_candidates ,
+				uim->cand_limit) ;
+		}
+
 		(*uim->im.cand_screen->select)( uim->im.cand_screen , index) ;
 	}
 }
@@ -1616,6 +1637,8 @@
 		goto  error ;
 	}
 
+	uim->is_mozc = (strcmp( engine , "mozc") == 0) ;
+
 	uim_set_preedit_cb( uim->context ,
 			    preedit_clear ,
 			    preedit_pushback ,
diff -r ac6ec6344d05 xwindow/x_screen.c
--- a/xwindow/x_screen.c
+++ b/xwindow/x_screen.c
@@ -5268,11 +5268,13 @@
  * Callbacks of x_config_event_listener_t events.
  */
 
-static char *
+static void
 get_config_intern(
 	x_screen_t *  screen ,
 	char *  dev ,	/* can be NULL */
-	char *  key	/* can be "error" */
+	char *  key ,	/* can be "error" */
+	int  to_menu ,	/* -1: don't output to pty and menu. */
+	int *  flag	/* 1(true), 0(false) or -1(other) is returned. */
 	)
 {
 	ml_term_t *  term ;
@@ -5285,7 +5287,7 @@
 		if( ( term = (*screen->system_listener->get_pty)( screen->system_listener->self ,
 				dev)) == NULL)
 		{
-			return  NULL ;
+			return ;
 		}
 	}
 	else
@@ -5829,7 +5831,34 @@
 		}
 	}
 
-	return  value ;
+	if( to_menu >= 0)
+	{
+		if( value == NULL)
+		{
+			ml_term_write( screen->term , "#error\n" , 7 , to_menu) ;
+
+		#ifdef  __DEBUG
+			kik_debug_printf( KIK_DEBUG_TAG " #error\n") ;
+		#endif
+		}
+		else
+		{
+			ml_term_write( screen->term , "#" , 1 , to_menu) ;
+			ml_term_write( screen->term , key , strlen( key) , to_menu) ;
+			ml_term_write( screen->term , "=" , 1 , to_menu) ;
+			ml_term_write( screen->term , value , strlen( value) , to_menu) ;
+			ml_term_write( screen->term , "\n" , 1 , to_menu) ;
+
+		#ifdef  __DEBUG
+			kik_debug_printf( KIK_DEBUG_TAG " #%s=%s\n" , key , value) ;
+		#endif
+		}
+	}
+
+	if( flag)
+	{
+		*flag = value ? true_or_false( value) : -1 ;
+	}
 }
 
 static void
@@ -5840,31 +5869,7 @@
 	int  to_menu
 	)
 {
-	x_screen_t *  screen ;
-	char *  value ;
-
-	screen = p ;
-
-	if( ( value = get_config_intern( screen , dev , key)) == NULL)
-	{
-		ml_term_write( screen->term , "#error\n" , 7 , to_menu) ;
-
-	#ifdef  __DEBUG
-		kik_debug_printf( KIK_DEBUG_TAG " #error\n") ;
-	#endif
-	}
-	else
-	{
-		ml_term_write( screen->term , "#" , 1 , to_menu) ;
-		ml_term_write( screen->term , key , strlen( key) , to_menu) ;
-		ml_term_write( screen->term , "=" , 1 , to_menu) ;
-		ml_term_write( screen->term , value , strlen( value) , to_menu) ;
-		ml_term_write( screen->term , "\n" , 1 , to_menu) ;
-
-	#ifdef  __DEBUG
-		kik_debug_printf( KIK_DEBUG_TAG " #%s=%s\n" , key , value) ;
-	#endif
-	}
+	get_config_intern( p , dev , key , to_menu , NULL) ;
 }
 
 static void
@@ -8286,18 +8291,21 @@
 	}
 	else if( strcmp( value , "switch") == 0)
 	{
-		char *  val ;
-
-		if( ( val = get_config_intern( screen , /* dev */ NULL , key)))
-		{
-			if( strcmp( val , "true") == 0)
-			{
-				value = "false" ;
-			}
-			else if( strcmp( val , "false") == 0)
-			{
-				value = "true" ;
-			}
+		int  flag ;
+
+		get_config_intern( screen , /* dev */ NULL , key , -1 , &flag) ;
+
+		if( flag == 1)
+		{
+			value = "false" ;
+		}
+		else if( flag == 0)
+		{
+			value = "true" ;
+		}
+		else
+		{
+			return  1 ;
 		}
 	}
 
@@ -8312,7 +8320,7 @@
 		if( ( term = (*screen->system_listener->get_pty)( screen->system_listener->self ,
 				dev)) == NULL)
 		{
-			return  0 ;
+			return  1 ;
 		}
 	}
 	else
@@ -8838,7 +8846,7 @@
 			}
 			else
 			{
-				return  0 ;
+				return  1 ;
 			}
 
 			usascii_font_cs_changed( screen , ml_term_get_encoding( screen->term)) ;