Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add "native" wayland clipboard backend and several related properties #15704

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

na-na-hi
Copy link
Contributor

This adds a "native" Wayland clipboard backend based on the wlr-data-control-unstable-v1/ext-data-control-v1 protocol.

This backend overcomes the limitation of the VO (Wayland core protocol) backend, and does not require the presence of the VO window to receive clipboard updates. The backend runs in a separate thread, so clipboard reading does not stall the player like the VO backend.

This backend also supports primary selection if supported by the compositor. The clipboard/text-primary property is added for primary selection text.

Also add current-clipboard-backend property to make the current backend detectable, and update console.lua to use the new backend if available.

It's only used for logging, and further creation of log contexts
can use the parenting feature instead, so there is no need to
store it.
This adds clipboard backend names to backend-specific logs,
e.g. clipboard/vo.
This adds a "native" Wayland clipboard backend based on the
wlr-data-control-unstable-v1/ext-data-control-v1 protocol.
This backend overcomes the limitation of the VO (Wayland core protocol)
backend, and does not require the presence of the VO window to receive clipboard
updates.
This backend also supports primary selection if supported by the compositor.

The backend runs in a separate thread, so clipboard reading
does not stall the player like the VO backend.
This property contains the text in the primary selection.
Some platforms like Wayland may have support for multiple backends,
so add this function to make it possible to determine the current
active backend.
Useful to know which clipboard backend is active.
This backend does not require the window focus quirk handling,
and also supports primary selection.
@llyyr
Copy link
Contributor

llyyr commented Jan 18, 2025

Haven't looked too closely, but mpv doesn't use wlr-* or any compositor specific protocols. I'd suggest removing wlr-data-control-unstable-v1 and using only ext-data-control-v1 here. We have the vo backend for fallback anyway.

Copy link

github-actions bot commented Jan 18, 2025

Download the artifacts for this pull request:

Windows
macOS

@na-na-hi na-na-hi force-pushed the wayland-clipboard branch 3 times, most recently from 9fdd20d to 2fc1ad3 Compare January 18, 2025 08:13
@layercak3
Copy link
Contributor

This should probably behave like c9412b4 for consistency with the vo backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants