From 1ee207329a45ca41bd73be7cacad7438b4ff82ad Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Wed, 3 Dec 2025 11:23:40 -0500 Subject: [PATCH] clipboard-x11: use separate properties to receive primary and clipboard Fixes one of the property not being set when a client sets primary and clipboard at the same time. --- player/clipboard/clipboard-x11.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/player/clipboard/clipboard-x11.c b/player/clipboard/clipboard-x11.c index 7460bb269b..c61264ac38 100644 --- a/player/clipboard/clipboard-x11.c +++ b/player/clipboard/clipboard-x11.c @@ -186,11 +186,12 @@ static bool clipboard_x11_dispatch_events(struct clipboard_x11_priv *x11, int64_ MP_TRACE(x11, "XEvent: %d\n", event.type); if (event.type == x11->XFixesSelectionNotifyEvent) { XFixesSelectionNotifyEvent *ev = (XFixesSelectionNotifyEvent *)&event; - if (ev->owner != x11->window && - (ev->selection == XA(x11, CLIPBOARD) || ev->selection == XA_PRIMARY)) - { + if (ev->owner != x11->window && ev->selection == XA(x11, CLIPBOARD)) { XConvertSelection(x11->display, ev->selection, XA(x11, UTF8_STRING), - XA(x11, MPV_SELECTION), x11->window, CurrentTime); + XA(x11, MPV_CLIPBOARD), x11->window, CurrentTime); + } else if (ev->owner != x11->window && ev->selection == XA_PRIMARY) { + XConvertSelection(x11->display, ev->selection, XA(x11, UTF8_STRING), + XA(x11, MPV_PRIMARY), x11->window, CurrentTime); } } else if (event.type == SelectionRequest) { clipboard_x11_handle_selection_request(x11, &event);