patch 9.1.1485: missing Wayland clipboard support
Problem: missing Wayland clipboard support
Solution: make it work (Foxe Chen)
fixes: #5157
closes: #17097
Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/globals.h b/src/globals.h
index 38e9b8b..31fbf4f 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -971,9 +971,9 @@
#endif
#ifdef FEAT_CLIPBOARD
-EXTERN Clipboard_T clip_star; // PRIMARY selection in X11
-# ifdef FEAT_X11
-EXTERN Clipboard_T clip_plus; // CLIPBOARD selection in X11
+EXTERN Clipboard_T clip_star; // PRIMARY selection in X11/Wayland
+# if defined(FEAT_X11) || defined(FEAT_WAYLAND_CLIPBOARD)
+EXTERN Clipboard_T clip_plus; // CLIPBOARD selection in X11/Wayland
# else
# define clip_plus clip_star // there is only one clipboard
# define ONE_CLIPBOARD
@@ -2069,3 +2069,23 @@
#ifdef FEAT_TERMGUICOLORS
EXTERN int p_tgc_set INIT(= FALSE);
#endif
+
+// If we've already warned about missing/unavailable clipboard
+EXTERN int did_warn_clipboard INIT(= FALSE);
+
+#ifdef FEAT_CLIPBOARD
+EXTERN clipmethod_T clipmethod INIT(= CLIPMETHOD_NONE);
+#endif
+
+#ifdef FEAT_WAYLAND
+
+// Don't connect to wayland compositor if TRUE
+EXTERN int wayland_no_connect INIT(= FALSE);
+
+// Wayland display name (ex. wayland-0). Can be NULL
+EXTERN char *wayland_display_name INIT(= NULL);
+
+// Wayland display file descriptor; set by wayland_init_client()
+EXTERN int wayland_display_fd;
+
+#endif