From 74c7d2521e8ca8464879134618f46828e40bb11c Mon Sep 17 00:00:00 2001 From: dogknowsnx Date: Wed, 23 Jul 2025 13:11:32 +0200 Subject: [PATCH] mpv: add patch to fix clipboard polling on wayland Upstream backport: https://github.com/mpv-player/mpv/pull/16140 --- srcpkgs/mpv/patches/fix-clipboard-polling.patch | 16 ++++++++++++++++ srcpkgs/mpv/template | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/mpv/patches/fix-clipboard-polling.patch diff --git a/srcpkgs/mpv/patches/fix-clipboard-polling.patch b/srcpkgs/mpv/patches/fix-clipboard-polling.patch new file mode 100644 index 00000000000..13612bed860 --- /dev/null +++ b/srcpkgs/mpv/patches/fix-clipboard-polling.patch @@ -0,0 +1,16 @@ +https://github.com/mpv-player/mpv/pull/16140 +--- a/player/clipboard/clipboard-wayland.c ++++ b/player/clipboard/clipboard-wayland.c +@@ -348,6 +348,12 @@ static bool clipboard_wayland_dispatch_events(struct clipboard_wayland_priv *wl, + if (fds[1].revents & POLLIN) + return false; + ++ if (fds[2].revents & (POLLERR | POLLHUP | POLLNVAL)) ++ destroy_offer(wl->selection_offer); ++ ++ if (fds[3].revents & (POLLERR | POLLHUP | POLLNVAL)) ++ destroy_offer(wl->primary_selection_offer); ++ + if (fds[2].revents & POLLIN) + get_selection_data(wl, wl->selection_offer, false); + diff --git a/srcpkgs/mpv/template b/srcpkgs/mpv/template index 2cfbde88c94..01df2700d2a 100644 --- a/srcpkgs/mpv/template +++ b/srcpkgs/mpv/template @@ -1,7 +1,7 @@ # Template file for 'mpv' pkgname=mpv version=0.40.0 -revision=2 +revision=3 build_style=meson configure_args="-Dcdda=enabled -Ddvbin=enabled -Ddvdnav=enabled -Dlibmpv=true -Dcplugins=enabled