about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/wrapped/wrappedwaylandclient.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/wrapped/wrappedwaylandclient.c b/src/wrapped/wrappedwaylandclient.c
index e300678b..c03d7c3c 100644
--- a/src/wrapped/wrappedwaylandclient.c
+++ b/src/wrapped/wrappedwaylandclient.c
@@ -956,6 +956,33 @@ static void* find_wl_data_offer_listener_Fct(void* fct)
     printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_data_offer_listener callback\n");
     return NULL;
 }
+// zwp_primary_selection_offer_v1_listener ...
+typedef struct my_zwp_primary_selection_offer_v1_listener_s {
+    uintptr_t   primary_offer; //vFppp
+} my_zwp_primary_selection_offer_v1_listener_t;
+#define GO(A)   \
+static my_zwp_primary_selection_offer_v1_listener_t* ref_zwp_primary_selection_offer_v1_listener_##A = NULL;    \
+static void my_zwp_primary_selection_offer_v1_listener_primary_offer_##A(void* a, void* b, void* c)             \
+{                                                                                                               \
+    RunFunctionFmt(ref_zwp_primary_selection_offer_v1_listener_##A->primary_offer, "ppp", a, b, c);             \
+}                                                                                                               \
+static my_zwp_primary_selection_offer_v1_listener_t my_zwp_primary_selection_offer_v1_listener_fct_##A = {      \
+    (uintptr_t)my_zwp_primary_selection_offer_v1_listener_primary_offer_##A,                                    \
+};
+SUPER()
+#undef GO
+static void* find_zwp_primary_selection_offer_v1_listener_Fct(void* fct)
+{
+    if(!fct) return fct;
+    #define GO(A) if(ref_zwp_primary_selection_offer_v1_listener_##A == fct) return &my_zwp_primary_selection_offer_v1_listener_fct_##A;
+    SUPER()
+    #undef GO
+    #define GO(A) if(ref_zwp_primary_selection_offer_v1_listener_##A == 0) {ref_zwp_primary_selection_offer_v1_listener_##A = fct; return &my_zwp_primary_selection_offer_v1_listener_fct_##A; }
+    SUPER()
+    #undef GO
+    printf_log(LOG_NONE, "Warning, no more slot for wayland-client zwp_primary_selection_offer_v1_listener callback\n");
+    return NULL;
+}
 
 #undef SUPER
 
@@ -1006,6 +1033,8 @@ EXPORT int my_wl_proxy_add_listener(x64emu_t* emu, void* proxy, void** l, void*
         l = find_zwp_primary_selection_device_v1_listener_Fct(l);
     } else if(!strcmp(proxy_name, "wl_data_offer")) {
         l = find_wl_data_offer_listener_Fct(l);
+    } else if(!strcmp(proxy_name, "zwp_primary_selection_offer_v1")) {
+        l = find_zwp_primary_selection_offer_v1_listener_Fct(l);
     } else
         printf_log(LOG_INFO, "Error, Wayland-client, add_listener to %s unknown, will crash soon!\n", proxy_name);
     return my->wl_proxy_add_listener(proxy, l, data);