]>
Commit | Line | Data |
---|---|---|
3d402657 | 1 | To: vim_dev@googlegroups.com |
2 | Subject: Patch 7.3.277 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.3.277 | |
11 | Problem: MS-Windows: some characters do not show in dialogs. | |
12 | Solution: Use the wide methods when available. (Yanwei Jia) | |
13 | Files: src/gui_w32.c, src/gui_w48.c, src/os_mswin.c, src/os_win32.c, | |
14 | src/os_win32.h | |
15 | ||
16 | ||
17 | *** ../vim-7.3.276/src/gui_w32.c 2011-08-10 15:56:24.000000000 +0200 | |
18 | --- src/gui_w32.c 2011-08-10 16:52:55.000000000 +0200 | |
19 | *************** | |
20 | *** 1270,1275 **** | |
21 | --- 1270,1294 ---- | |
22 | pGetMonitorInfo = (TGetMonitorInfo)GetProcAddress(user32_lib, | |
23 | "GetMonitorInfoA"); | |
24 | } | |
25 | + | |
26 | + #ifdef FEAT_MBYTE | |
27 | + /* If the OS is Windows NT, use wide functions; | |
28 | + * this enables common dialogs input unicode from IME. */ | |
29 | + if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT) | |
30 | + { | |
31 | + pDispatchMessage = DispatchMessageW; | |
32 | + pGetMessage = GetMessageW; | |
33 | + pIsDialogMessage = IsDialogMessageW; | |
34 | + pPeekMessage = PeekMessageW; | |
35 | + } | |
36 | + else | |
37 | + { | |
38 | + pDispatchMessage = DispatchMessageA; | |
39 | + pGetMessage = GetMessageA; | |
40 | + pIsDialogMessage = IsDialogMessageA; | |
41 | + pPeekMessage = PeekMessageA; | |
42 | + } | |
43 | + #endif | |
44 | } | |
45 | ||
46 | /* | |
47 | *** ../vim-7.3.276/src/gui_w48.c 2010-10-20 21:22:17.000000000 +0200 | |
48 | --- src/gui_w48.c 2011-08-10 16:49:39.000000000 +0200 | |
49 | *************** | |
50 | *** 390,396 **** | |
51 | KillTimer(NULL, idEvent); | |
52 | ||
53 | /* Eat spurious WM_TIMER messages */ | |
54 | ! while (PeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) | |
55 | ; | |
56 | ||
57 | if (blink_state == BLINK_ON) | |
58 | --- 390,396 ---- | |
59 | KillTimer(NULL, idEvent); | |
60 | ||
61 | /* Eat spurious WM_TIMER messages */ | |
62 | ! while (pPeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) | |
63 | ; | |
64 | ||
65 | if (blink_state == BLINK_ON) | |
66 | *************** | |
67 | *** 418,424 **** | |
68 | { | |
69 | KillTimer(NULL, blink_timer); | |
70 | /* Eat spurious WM_TIMER messages */ | |
71 | ! while (PeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) | |
72 | ; | |
73 | blink_timer = 0; | |
74 | } | |
75 | --- 418,424 ---- | |
76 | { | |
77 | KillTimer(NULL, blink_timer); | |
78 | /* Eat spurious WM_TIMER messages */ | |
79 | ! while (pPeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) | |
80 | ; | |
81 | blink_timer = 0; | |
82 | } | |
83 | *************** | |
84 | *** 476,482 **** | |
85 | s_timed_out = TRUE; | |
86 | ||
87 | /* Eat spurious WM_TIMER messages */ | |
88 | ! while (PeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) | |
89 | ; | |
90 | if (idEvent == s_wait_timer) | |
91 | s_wait_timer = 0; | |
92 | --- 476,482 ---- | |
93 | s_timed_out = TRUE; | |
94 | ||
95 | /* Eat spurious WM_TIMER messages */ | |
96 | ! while (pPeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) | |
97 | ; | |
98 | if (idEvent == s_wait_timer) | |
99 | s_wait_timer = 0; | |
100 | *************** | |
101 | *** 1707,1713 **** | |
102 | static char_u k10[] = {K_SPECIAL, 'k', ';', 0}; | |
103 | #endif | |
104 | ||
105 | ! GetMessage(&msg, NULL, 0, 0); | |
106 | ||
107 | #ifdef FEAT_OLE | |
108 | /* Look after OLE Automation commands */ | |
109 | --- 1707,1713 ---- | |
110 | static char_u k10[] = {K_SPECIAL, 'k', ';', 0}; | |
111 | #endif | |
112 | ||
113 | ! pGetMessage(&msg, NULL, 0, 0); | |
114 | ||
115 | #ifdef FEAT_OLE | |
116 | /* Look after OLE Automation commands */ | |
117 | *************** | |
118 | *** 1718,1724 **** | |
119 | { | |
120 | /* Message can't be ours, forward it. Fixes problem with Ultramon | |
121 | * 3.0.4 */ | |
122 | ! DispatchMessage(&msg); | |
123 | } | |
124 | else | |
125 | { | |
126 | --- 1718,1724 ---- | |
127 | { | |
128 | /* Message can't be ours, forward it. Fixes problem with Ultramon | |
129 | * 3.0.4 */ | |
130 | ! pDispatchMessage(&msg); | |
131 | } | |
132 | else | |
133 | { | |
134 | *************** | |
135 | *** 1749,1762 **** | |
136 | if (msg.message == WM_USER) | |
137 | { | |
138 | MyTranslateMessage(&msg); | |
139 | ! DispatchMessage(&msg); | |
140 | return; | |
141 | } | |
142 | #endif | |
143 | ||
144 | #ifdef MSWIN_FIND_REPLACE | |
145 | /* Don't process messages used by the dialog */ | |
146 | ! if (s_findrep_hwnd != NULL && IsDialogMessage(s_findrep_hwnd, &msg)) | |
147 | { | |
148 | HandleMouseHide(msg.message, msg.lParam); | |
149 | return; | |
150 | --- 1749,1762 ---- | |
151 | if (msg.message == WM_USER) | |
152 | { | |
153 | MyTranslateMessage(&msg); | |
154 | ! pDispatchMessage(&msg); | |
155 | return; | |
156 | } | |
157 | #endif | |
158 | ||
159 | #ifdef MSWIN_FIND_REPLACE | |
160 | /* Don't process messages used by the dialog */ | |
161 | ! if (s_findrep_hwnd != NULL && pIsDialogMessage(s_findrep_hwnd, &msg)) | |
162 | { | |
163 | HandleMouseHide(msg.message, msg.lParam); | |
164 | return; | |
165 | *************** | |
166 | *** 1928,1934 **** | |
167 | if (vk != VK_F10 || check_map(k10, State, FALSE, TRUE, FALSE, | |
168 | NULL, NULL) == NULL) | |
169 | #endif | |
170 | ! DispatchMessage(&msg); | |
171 | } | |
172 | ||
173 | /* | |
174 | --- 1928,1934 ---- | |
175 | if (vk != VK_F10 || check_map(k10, State, FALSE, TRUE, FALSE, | |
176 | NULL, NULL) == NULL) | |
177 | #endif | |
178 | ! pDispatchMessage(&msg); | |
179 | } | |
180 | ||
181 | /* | |
182 | *************** | |
183 | *** 1943,1949 **** | |
184 | MSG msg; | |
185 | ||
186 | if (!s_busy_processing) | |
187 | ! while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) | |
188 | && !vim_is_input_buf_full()) | |
189 | process_message(); | |
190 | } | |
191 | --- 1943,1949 ---- | |
192 | MSG msg; | |
193 | ||
194 | if (!s_busy_processing) | |
195 | ! while (pPeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) | |
196 | && !vim_is_input_buf_full()) | |
197 | process_message(); | |
198 | } | |
199 | *************** | |
200 | *** 2019,2025 **** | |
201 | KillTimer(NULL, s_wait_timer); | |
202 | ||
203 | /* Eat spurious WM_TIMER messages */ | |
204 | ! while (PeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) | |
205 | ; | |
206 | s_wait_timer = 0; | |
207 | } | |
208 | --- 2019,2025 ---- | |
209 | KillTimer(NULL, s_wait_timer); | |
210 | ||
211 | /* Eat spurious WM_TIMER messages */ | |
212 | ! while (pPeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) | |
213 | ; | |
214 | s_wait_timer = 0; | |
215 | } | |
216 | *** ../vim-7.3.276/src/os_mswin.c 2011-06-19 01:30:01.000000000 +0200 | |
217 | --- src/os_mswin.c 2011-08-10 16:45:24.000000000 +0200 | |
218 | *************** | |
219 | *** 1856,1867 **** | |
220 | { | |
221 | MSG msg; | |
222 | ||
223 | ! while (!*bUserAbort && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) | |
224 | { | |
225 | ! if (!hDlgPrint || !IsDialogMessage(hDlgPrint, &msg)) | |
226 | { | |
227 | TranslateMessage(&msg); | |
228 | ! DispatchMessage(&msg); | |
229 | } | |
230 | } | |
231 | return !*bUserAbort; | |
232 | --- 1856,1867 ---- | |
233 | { | |
234 | MSG msg; | |
235 | ||
236 | ! while (!*bUserAbort && pPeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) | |
237 | { | |
238 | ! if (!hDlgPrint || !pIsDialogMessage(hDlgPrint, &msg)) | |
239 | { | |
240 | TranslateMessage(&msg); | |
241 | ! pDispatchMessage(&msg); | |
242 | } | |
243 | } | |
244 | return !*bUserAbort; | |
245 | *************** | |
246 | *** 3132,3141 **** | |
247 | { | |
248 | MSG msg; | |
249 | ||
250 | ! while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) | |
251 | { | |
252 | TranslateMessage(&msg); | |
253 | ! DispatchMessage(&msg); | |
254 | } | |
255 | } | |
256 | ||
257 | --- 3132,3141 ---- | |
258 | { | |
259 | MSG msg; | |
260 | ||
261 | ! while (pPeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) | |
262 | { | |
263 | TranslateMessage(&msg); | |
264 | ! pDispatchMessage(&msg); | |
265 | } | |
266 | } | |
267 | ||
268 | *** ../vim-7.3.276/src/os_win32.c 2011-07-07 16:20:45.000000000 +0200 | |
269 | --- src/os_win32.c 2011-08-10 16:54:50.000000000 +0200 | |
270 | *************** | |
271 | *** 152,157 **** | |
272 | --- 152,165 ---- | |
273 | # define wcsicmp(a, b) wcscmpi((a), (b)) | |
274 | #endif | |
275 | ||
276 | + /* Enable common dialogs input unicode from IME if posible. */ | |
277 | + #ifdef FEAT_MBYTE | |
278 | + LRESULT (WINAPI *pDispatchMessage)(LPMSG) = DispatchMessage; | |
279 | + BOOL (WINAPI *pGetMessage)(LPMSG, HWND, UINT, UINT) = GetMessage; | |
280 | + BOOL (WINAPI *pIsDialogMessage)(HWND, LPMSG) = IsDialogMessage; | |
281 | + BOOL (WINAPI *pPeekMessage)(LPMSG, HWND, UINT, UINT, UINT) = PeekMessage; | |
282 | + #endif | |
283 | + | |
284 | #ifndef FEAT_GUI_W32 | |
285 | /* Win32 Console handles for input and output */ | |
286 | static HANDLE g_hConIn = INVALID_HANDLE_VALUE; | |
287 | *************** | |
288 | *** 3284,3293 **** | |
289 | { | |
290 | MSG msg; | |
291 | ||
292 | ! if (PeekMessage(&msg, (HWND)NULL, 0, 0, PM_REMOVE)) | |
293 | { | |
294 | TranslateMessage(&msg); | |
295 | ! DispatchMessage(&msg); | |
296 | } | |
297 | if (WaitForSingleObject(pi.hProcess, delay) != WAIT_TIMEOUT) | |
298 | break; | |
299 | --- 3292,3301 ---- | |
300 | { | |
301 | MSG msg; | |
302 | ||
303 | ! if (pPeekMessage(&msg, (HWND)NULL, 0, 0, PM_REMOVE)) | |
304 | { | |
305 | TranslateMessage(&msg); | |
306 | ! pDispatchMessage(&msg); | |
307 | } | |
308 | if (WaitForSingleObject(pi.hProcess, delay) != WAIT_TIMEOUT) | |
309 | break; | |
310 | *** ../vim-7.3.276/src/os_win32.h 2011-05-05 18:31:54.000000000 +0200 | |
311 | --- src/os_win32.h 2011-08-10 16:51:58.000000000 +0200 | |
312 | *************** | |
313 | *** 193,195 **** | |
314 | --- 193,209 ---- | |
315 | #else | |
316 | # define vim_mkdir(x, y) mch_mkdir(x) | |
317 | #endif | |
318 | + | |
319 | + /* Enable common dialogs input unicode from IME if posible. */ | |
320 | + #ifdef FEAT_MBYTE | |
321 | + /* The variables are defined in os_win32.c. */ | |
322 | + extern LRESULT (WINAPI *pDispatchMessage)(LPMSG); | |
323 | + extern BOOL (WINAPI *pGetMessage)(LPMSG, HWND, UINT, UINT); | |
324 | + extern BOOL (WINAPI *pIsDialogMessage)(HWND, LPMSG); | |
325 | + extern BOOL (WINAPI *pPeekMessage)(LPMSG, HWND, UINT, UINT, UINT); | |
326 | + #else | |
327 | + # define pDispatchMessage DispatchMessage | |
328 | + # define pGetMessage GetMessage | |
329 | + # define pIsDialogMessage IsDialogMessage | |
330 | + # define pPeekMessage PeekMessage | |
331 | + #endif | |
332 | *** ../vim-7.3.276/src/version.c 2011-08-10 16:31:18.000000000 +0200 | |
333 | --- src/version.c 2011-08-10 17:06:55.000000000 +0200 | |
334 | *************** | |
335 | *** 711,712 **** | |
336 | --- 711,714 ---- | |
337 | { /* Add new patch number below this line */ | |
338 | + /**/ | |
339 | + 277, | |
340 | /**/ | |
341 | ||
342 | -- | |
343 | Veni, Vidi, VW -- I came, I saw, I drove around in a little car. | |
344 | ||
345 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
346 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
347 | \\\ an exciting new programming language -- http://www.Zimbu.org /// | |
348 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |