diff --git a/media-video/mpv/files/mpv-0.40.0-wayland-clipboard-cpu.patch b/media-video/mpv/files/mpv-0.40.0-wayland-clipboard-cpu.patch new file mode 100644 index 0000000000000..0432d65b29b58 --- /dev/null +++ b/media-video/mpv/files/mpv-0.40.0-wayland-clipboard-cpu.patch @@ -0,0 +1,16 @@ +https://bugs.gentoo.org/959000 +https://github.com/mpv-player/mpv/issues/16139 +https://github.com/mpv-player/mpv/pull/16140 +--- a/player/clipboard/clipboard-wayland.c ++++ b/player/clipboard/clipboard-wayland.c +@@ -349,4 +349,10 @@ + 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/media-video/mpv/mpv-0.40.0-r2.ebuild b/media-video/mpv/mpv-0.40.0-r3.ebuild similarity index 99% rename from media-video/mpv/mpv-0.40.0-r2.ebuild rename to media-video/mpv/mpv-0.40.0-r3.ebuild index 61d81da0b6eba..d1d23d274ba2c 100644 --- a/media-video/mpv/mpv-0.40.0-r2.ebuild +++ b/media-video/mpv/mpv-0.40.0-r3.ebuild @@ -124,6 +124,10 @@ BDEPEND=" wayland? ( dev-util/wayland-scanner ) " +PATCHES=( + "${FILESDIR}"/${P}-wayland-clipboard-cpu.patch +) + pkg_pretend() { if has_version "${CATEGORY}/${PN}[X,opengl]" && use !egl; then #953107 ewarn "${PN}'s 'opengl' USE was removed in favour of the 'egl' USE as it was"