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/structs.h b/src/structs.h
index 250dc2f..423757a 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -4831,7 +4831,7 @@
#define DELETION_REGISTER 36
#ifdef FEAT_CLIPBOARD
# define STAR_REGISTER 37
-# ifdef FEAT_X11
+# if defined(FEAT_X11) || defined(FEAT_WAYLAND)
# define PLUS_REGISTER 38
# else
# define PLUS_REGISTER STAR_REGISTER // there is only one
@@ -5187,3 +5187,23 @@
int cs_ypixel;
};
#endif
+
+#ifdef FEAT_WAYLAND
+
+// Wayland selections
+typedef enum {
+ WAYLAND_SELECTION_NONE = 0x0,
+ WAYLAND_SELECTION_REGULAR = 0x1,
+ WAYLAND_SELECTION_PRIMARY = 0x2,
+} wayland_selection_T;
+
+// Callback when another client wants us to send data to them
+typedef void (*wayland_cb_send_data_func_T)(
+ const char *mime_type,
+ int fd,
+ wayland_selection_T type);
+
+// Callback when the selection is lost (data source object overwritten)
+typedef void (*wayland_cb_selection_cancelled_func_T)(wayland_selection_T type);
+
+#endif // FEAT_WAYLAND