To: vim_dev@googlegroups.com Subject: Patch 8.2.4170 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4170 Problem: MS-Windows: still using old message API calls. Solution: Call the "W" functions directly. (Ken Takata, closes #9582) Files: src/gui_w32.c, src/os_mswin.c, src/os_win32.c, src/os_win32.h *** ../vim-8.2.4169/src/gui_w32.c 2022-01-21 11:10:56.019178101 +0000 --- src/gui_w32.c 2022-01-21 11:36:01.753858935 +0000 *************** *** 636,642 **** KillTimer(NULL, idEvent); // Eat spurious WM_TIMER messages ! while (pPeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) ; if (blink_state == BLINK_ON) --- 636,642 ---- KillTimer(NULL, idEvent); // Eat spurious WM_TIMER messages ! while (PeekMessageW(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) ; if (blink_state == BLINK_ON) *************** *** 665,671 **** { KillTimer(NULL, blink_timer); // Eat spurious WM_TIMER messages ! while (pPeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) ; blink_timer = 0; } --- 665,671 ---- { KillTimer(NULL, blink_timer); // Eat spurious WM_TIMER messages ! while (PeekMessageW(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) ; blink_timer = 0; } *************** *** 726,732 **** s_timed_out = TRUE; // Eat spurious WM_TIMER messages ! while (pPeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) ; if (idEvent == s_wait_timer) s_wait_timer = 0; --- 726,732 ---- s_timed_out = TRUE; // Eat spurious WM_TIMER messages ! while (PeekMessageW(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) ; if (idEvent == s_wait_timer) s_wait_timer = 0; *************** *** 1844,1850 **** static char_u k10[] = {K_SPECIAL, 'k', ';', 0}; #endif ! pGetMessage(&msg, NULL, 0, 0); #ifdef FEAT_OLE // Look after OLE Automation commands --- 1844,1850 ---- static char_u k10[] = {K_SPECIAL, 'k', ';', 0}; #endif ! GetMessageW(&msg, NULL, 0, 0); #ifdef FEAT_OLE // Look after OLE Automation commands *************** *** 1855,1861 **** { // Message can't be ours, forward it. Fixes problem with Ultramon // 3.0.4 ! pDispatchMessage(&msg); } else { --- 1855,1861 ---- { // Message can't be ours, forward it. Fixes problem with Ultramon // 3.0.4 ! DispatchMessageW(&msg); } else { *************** *** 1868,1874 **** #ifdef MSWIN_FIND_REPLACE // Don't process messages used by the dialog ! if (s_findrep_hwnd != NULL && pIsDialogMessage(s_findrep_hwnd, &msg)) { HandleMouseHide(msg.message, msg.lParam); return; --- 1868,1874 ---- #ifdef MSWIN_FIND_REPLACE // Don't process messages used by the dialog ! if (s_findrep_hwnd != NULL && IsDialogMessageW(s_findrep_hwnd, &msg)) { HandleMouseHide(msg.message, msg.lParam); return; *************** *** 2065,2071 **** if (vk != VK_F10 || check_map(k10, State, FALSE, TRUE, FALSE, NULL, NULL) == NULL) #endif ! pDispatchMessage(&msg); } /* --- 2065,2071 ---- if (vk != VK_F10 || check_map(k10, State, FALSE, TRUE, FALSE, NULL, NULL) == NULL) #endif ! DispatchMessageW(&msg); } /* *************** *** 2080,2086 **** MSG msg; if (!s_busy_processing) ! while (pPeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) && !vim_is_input_buf_full()) process_message(); } --- 2080,2086 ---- MSG msg; if (!s_busy_processing) ! while (PeekMessageW(&msg, NULL, 0, 0, PM_NOREMOVE) && !vim_is_input_buf_full()) process_message(); } *************** *** 2095,2101 **** KillTimer(NULL, s_wait_timer); // Eat spurious WM_TIMER messages ! while (pPeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) ; s_wait_timer = 0; } --- 2095,2101 ---- KillTimer(NULL, s_wait_timer); // Eat spurious WM_TIMER messages ! while (PeekMessageW(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) ; s_wait_timer = 0; } *************** *** 2163,2169 **** if (did_add_timer) break; # endif ! if (pPeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) { process_message(); break; --- 2163,2169 ---- if (did_add_timer) break; # endif ! if (PeekMessageW(&msg, NULL, 0, 0, PM_NOREMOVE)) { process_message(); break; *** ../vim-8.2.4169/src/os_mswin.c 2022-01-04 19:57:50.930919989 +0000 --- src/os_mswin.c 2022-01-21 11:36:01.753858935 +0000 *************** *** 1123,1134 **** { MSG msg; ! while (!*bUserAbort && pPeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { ! if (!hDlgPrint || !pIsDialogMessage(hDlgPrint, &msg)) { TranslateMessage(&msg); ! pDispatchMessage(&msg); } } return !*bUserAbort; --- 1123,1134 ---- { MSG msg; ! while (!*bUserAbort && PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) { ! if (!hDlgPrint || !IsDialogMessageW(hDlgPrint, &msg)) { TranslateMessage(&msg); ! DispatchMessageW(&msg); } } return !*bUserAbort; *************** *** 2576,2585 **** { MSG msg; ! while (pPeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); ! pDispatchMessage(&msg); } } --- 2576,2585 ---- { MSG msg; ! while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); ! DispatchMessageW(&msg); } } *** ../vim-8.2.4169/src/os_win32.c 2022-01-08 16:19:18.505639885 +0000 --- src/os_win32.c 2022-01-21 11:36:01.757858859 +0000 *************** *** 4123,4132 **** { MSG msg; ! if (pPeekMessage(&msg, (HWND)NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); ! pDispatchMessage(&msg); delay = 1; continue; } --- 4123,4132 ---- { MSG msg; ! if (PeekMessageW(&msg, (HWND)NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); ! DispatchMessageW(&msg); delay = 1; continue; } *************** *** 4445,4454 **** { MSG msg; ! if (pPeekMessage(&msg, (HWND)NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); ! pDispatchMessage(&msg); } // write pipe information in the window --- 4445,4454 ---- { MSG msg; ! if (PeekMessageW(&msg, (HWND)NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); ! DispatchMessageW(&msg); } // write pipe information in the window *** ../vim-8.2.4169/src/os_win32.h 2021-12-27 17:21:38.016449116 +0000 --- src/os_win32.h 2022-01-21 11:36:01.757858859 +0000 *************** *** 199,207 **** #endif #define mch_getenv(x) (char_u *)getenv((char *)(x)) #define vim_mkdir(x, y) mch_mkdir(x) - - // Enable common dialogs input unicode from IME if possible. - #define pDispatchMessage DispatchMessageW - #define pGetMessage GetMessageW - #define pIsDialogMessage IsDialogMessageW - #define pPeekMessage PeekMessageW --- 199,201 ---- *** ../vim-8.2.4169/src/version.c 2022-01-21 11:10:56.019178101 +0000 --- src/version.c 2022-01-21 11:36:38.389139078 +0000 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 4170, /**/ -- If "R" is Reverse, how come "D" is FORWARD? /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///