[vim/vim] GTK4: return focus to drawarea when a menubar popover closes (PR #20291)

0 views
Skip to first unread message

mattn

unread,
1:00 PM (8 hours ago) 1:00 PM
to vim/vim, Subscribed

On the GTK4 GUI, opening a menubar popover (File, Edit, etc.) and dismissing it without selecting an item leaves keyboard focus outside the drawing area, so the cursor stays in the unfocused (outline) shape until the pointer is moved back over the drawarea — at which point enter_notify_event re-grabs focus as a side effect.

This installs an emission hook on GtkPopover::closed and, when the closing popover descends from gui.menubar, schedules an idle callback that grabs focus back to the drawing area. The grab is deferred via g_idle_add because GTK is still completing the close transition when the signal fires, so a synchronous gtk_widget_grab_focus() is silently a no-op.

Fixes #20274


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

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

Commit Summary

  • df73a05 GTK4: return focus to drawarea when a menubar popover closes

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20291@github.com>

Reply all
Reply to author
Forward
0 new messages