With GTK4, after gvim owns the primary selection, pasting from another app via middle-click or \"*p returned gvim's own previously-selected text instead of the new owner's content. The X11 SelectionClear path no longer applies because GTK4 abstracts the clipboard through GdkClipboard, and we were not listening for ownership changes — so GdkClipboard kept returning its locally cached content.
This patch connects to ::changed on both gdk_display_get_primary_clipboard() and gdk_display_get_clipboard() in gui_mch_init(), and calls clip_lose_selection() whenever the change was not driven by us (gdk_clipboard_is_local() is false). A small re-entry flag prevents clip_mch_set_selection() from triggering its own loss callback.
Implemented purely through GdkClipboard, no X11-specific code.
Fixes #20256
https://github.com/vim/vim/pull/20261
(1 file)
—
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.![]()
—
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.![]()