[vim/vim] GTK4 primary selection paste doesn't work (Issue #20256)

6 views
Skip to first unread message

依云

unread,
May 20, 2026, 12:42:57 AM (5 days ago) May 20
to vim/vim, Subscribed
lilydjwg created an issue (vim/vim#20256)

Steps to reproduce

  1. Run vim -g --clean
  2. Input and select some text in GVim so that it owns primary selection
  3. Select text in another application
  4. GVim doesn't lose the selection ownership. It can't paste the selection from another application via middle click or "*p". Instead, it pastes its own selection like the other application doesn't exist.

Expected behaviour

GVim can paste primary selection owned by another application.

Version of Vim

9.2.491

Environment

Arch Linux GTK 4 GUI, Wayland compositor.

Logs and stack traces


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/issues/20256@github.com>

mattn

unread,
May 20, 2026, 1:26:03 AM (5 days ago) May 20
to vim/vim, Subscribed
mattn left a comment (vim/vim#20256)

Could you try #20261 and let me know if it fixes the primary selection paste? Thanks.


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/issues/20256/4494788919@github.com>

依云

unread,
May 20, 2026, 2:33:54 AM (5 days ago) May 20
to vim/vim, Subscribed
lilydjwg left a comment (vim/vim#20256)

Better but not complete. The selection is lost when I select text in another application, but Nothing in register * when pasting. Also Nothing in register + after copying text in another application.


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/issues/20256/4495286610@github.com>

mattn

unread,
May 24, 2026, 7:29:07 AM (18 hours ago) May 24
to vim/vim, Subscribed
mattn left a comment (vim/vim#20256)

Thanks, that hint pointed straight at the bug. clipboard_changed_cb was cascading into clip_mch_lose_selection, which unconditionally called gdk_clipboard_set_content(clipboard, NULL) — so right after a foreign app took the selection we immediately re-claimed it with NULL content, and any subsequent paste read back empty. The latest push to #20261 guards that set_content(NULL) behind gdk_clipboard_is_local(). Could you give it another try?


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/issues/20256/4528372911@github.com>

Christian Brabandt

unread,
May 24, 2026, 1:37:04 PM (12 hours ago) May 24
to vim/vim, Subscribed

Closed #20256 as completed via 06ef3a5.


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/issue/20256/issue_event/25902650195@github.com>

Reply all
Reply to author
Forward
0 new messages