[vim/vim] Try to process WM_SETFOCUS event soon (PR #19167)

7 views
Skip to first unread message

MURAOKA Taro

unread,
Jan 12, 2026, 8:50:11 AMJan 12
to vim/vim, Subscribed

Problem: In gvim on Windows, a certain problem can occur when the WM_SETFOCUS event sent after an external command is not processed immediately.

The problem is that Test_normal11_showcmd may fail when running the test_normal.vim test. Investigation revealed that the trigger was an external command executed in the previous test,
Test_mouse_shape_after_failed_change, when two tests were executed consecutively. In gvim on Windows, a WM_SETFOCUS event will be sent when an external command finishes executing. This WM_SETFOCUS event is not processed immediately, but rather by redraw, which is expected to update showcmd. Because it is queued in typebuf at this time, clear_showcmd(), which expects typebuf to be empty, cannot update showcmd.

Solution: After posting WM_SETFOCUS, run the message loop to process it as quickly as possible.

Also added a test that simulates the above problem.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/19167

Commit Summary

  • 208d41a Try to process WM_SETFOCUS event soon

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19167@github.com>

MURAOKA Taro

unread,
Jan 12, 2026, 9:12:07 AMJan 12
to vim/vim, Subscribed
koron left a comment (vim/vim#19167)

I don't know why this isn't happening with the existing CI. I think it's probably due to one of the if_xxx interfaces.

I've disabled the patch so you can see that the newly added tests fail without the patch. See below:


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19167/c3738748536@github.com>

Christian Brabandt

unread,
Jan 13, 2026, 4:33:57 PMJan 13
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19167)

Thanks, but this will go after the release.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19167/c3746665830@github.com>

Ari4ka

unread,
Feb 20, 2026, 7:49:22 PM (4 days ago) Feb 20
to vim/vim, Subscribed

@Ari4ka approved this pull request.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19167/review/3834732902@github.com>

Christian Brabandt

unread,
4:36 PM (6 hours ago) 4:36 PM
to vim/vim, Subscribed

Closed #19167 via c4a6fa3.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19167/issue_event/23048565857@github.com>

Reply all
Reply to author
Forward
0 new messages