From bc4f5ce2baa992be249c7ffcb18efa9f2631b972 Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Thu, 19 Mar 2026 01:45:39 -0400 Subject: [PATCH] clipboard-wayland: notify clipboard updates to update-data waiters --- player/clipboard/clipboard-wayland.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/player/clipboard/clipboard-wayland.c b/player/clipboard/clipboard-wayland.c index 61079c81a5..ddcbbb0602 100644 --- a/player/clipboard/clipboard-wayland.c +++ b/player/clipboard/clipboard-wayland.c @@ -57,6 +57,8 @@ struct clipboard_wayland_priv { struct clipboard_wayland_data_offer *selection_offer; struct clipboard_wayland_data_offer *primary_selection_offer; bool monitor; + // accessed by both threads (protected by cl->lock) + struct clipboard_ctx *cl; }; struct clipboard_wayland_seat { @@ -409,6 +411,7 @@ static void get_selection_data(struct clipboard_wayland_priv *wl, struct clipboa wl->data_changed = true; mp_mutex_unlock(&wl->lock); content = (bstr){0}; + mp_clipboard_notify_update_data(wl->cl); } talloc_free(content.start); @@ -504,6 +507,7 @@ static int init(struct clipboard_ctx *cl, struct clipboard_init_params *params) { cl->priv = talloc_zero(cl, struct clipboard_wayland_priv); struct clipboard_wayland_priv *priv = cl->priv; + priv->cl = cl; priv->message_pipe[0] = priv->message_pipe[1] = priv->display_fd = -1; priv->log = mp_log_new(priv, cl->log, "wayland"); priv->selection_offer = talloc_zero(priv, struct clipboard_wayland_data_offer),