patch 9.1.1927: Wayland: clipboard code too complex

Problem:  Wayland: clipboard code too complex
Solution: Simplify clipboard related code around W23/W24
          (Foxe Chen).

Improve Wayland and clipboard related code:

- improve documentation
- remove unused code
- fix error handling
- remove warning per Clipboard_T

closes: #18794

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Foxe Chen
2025-11-25 22:04:58 +00:00
committed by Christian Brabandt
parent c11fbe51e6
commit efa3b1f86d
11 changed files with 55 additions and 91 deletions

View File

@ -1,4 +1,4 @@
*options.txt* For Vim version 9.1. Last change: 2025 Nov 23
*options.txt* For Vim version 9.1. Last change: 2025 Nov 25
VIM REFERENCE MANUAL by Bram Moolenaar
@ -1843,9 +1843,9 @@ A jump table for the options with a short description can be found at |Q_op|.
option, yank operations (but not delete, change or
put) will additionally copy the text into register
'*'. If Wayland is being used and the compositor does
not support the primary-selection-unstable-v1
protocol, then the regular selection is used in its
place. Only available with the |+X11| or
not support the primary selection then the regular
selection is used in its place. Only available with
the |+X11| or
|+wayland_clipboard| feature. Availability can be
checked with: >
if has('unnamedplus')

View File

@ -1,4 +1,4 @@
*wayland.txt* For Vim version 9.1. Last change: 2025 Nov 09
*wayland.txt* For Vim version 9.1. Last change: 2025 Nov 25
VIM REFERENCE MANUAL by Bram Moolenaar
@ -16,7 +16,8 @@ Wayland Protocol Support *wayland*
Functionality such as the clipboard for Wayland requires a seat to use. A
Wayland seat can consist of a keyboard, pointer, and touch device(s). The
seat to use can be set with the 'wlseat' option. Only useful if you use
multiple Wayland seats in the same Wayland session.
multiple Wayland seats in the same Wayland session. If you don't know what
this is means, then it likely does not matter for you.
*wayland-gui*
See |gui-wayland|. Please note that when using the GUI, Vim uses the toolkit
@ -63,11 +64,18 @@ should be bundled with libwayland on your system: >
If you don't get any match, then please see |wayland-focus-steal| for more
information.
Some compositors that are known to support either or both protocols:
1. KWin (KDE)
2. wlroots based (Sway, Labwc)
3. Niri
4. Hyprland
5. Wayfire
If you come from X11, then the regular Wayland selection is equivalent to the
CLIPBOARD selection in X11, and the primary Wayland selection equates to the
X11 primary selection. Accessing these selections is the same as X11 in Vim,
X11 PRIMARY selection. Accessing these selections is the same as X11 in Vim,
in which the + register is the regular selection, and the * register is the
primary selection, note that your compositor may not support primary
primary selection. Note that your compositor may not support primary
selections, see |wayland-primary-selection| for more details.
*wayland-persist*