media-video/mpv: backport cpu usage fix with wayland clipboard

Kind of simple, so doing it straight-to-stable.

Closes: https://bugs.gentoo.org/959000
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
This commit is contained in:
Ionen Wolkens
2025-06-25 11:14:28 -04:00
parent b17fc99d82
commit 6b9d8da01e
2 changed files with 20 additions and 0 deletions

View File

@@ -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);

View File

@@ -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"