From c399422722fdb85cef40ab49bfeed9b6cede5191 Mon Sep 17 00:00:00 2001 From: Attila Fidan Date: Mon, 12 May 2025 07:20:49 +0000 Subject: [PATCH] clipboard-wayland: flush display after creating data sources The data source requests are prepared inside create_data_sources from a different thread than the clipboard thread, so it is necessary to flush here. Otherwise, if mpv is not already managing the current selection, we'll have to wait until the clipboard thread reenters clipboard_wayland_dispatch_events for the request to be sent to the compositor and have the other clients be sent new the new selection, which may take up to 10 seconds. --- player/clipboard/clipboard-wayland.c | 1 + 1 file changed, 1 insertion(+) diff --git a/player/clipboard/clipboard-wayland.c b/player/clipboard/clipboard-wayland.c index 48c4f01111..115c6f0641 100644 --- a/player/clipboard/clipboard-wayland.c +++ b/player/clipboard/clipboard-wayland.c @@ -298,6 +298,7 @@ static void create_data_sources(struct clipboard_wayland_priv *wl) seat_create_data_source(seat, true); } } + wl_display_flush(wl->display); } static void clipboard_wayland_uninit(struct clipboard_wayland_priv *wl)