Files
mpv/video/out/meson.build
nanahi 9f2ac08851 clipboard-wayland: add Wayland clipboard backend
This adds a "native" Wayland clipboard backend based on the
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.
2025-01-27 18:51:31 +01:00

54 lines
2.4 KiB
Meson

wl_protocol_dir = wayland['deps'][2].get_variable(pkgconfig: 'pkgdatadir', internal: 'pkgdatadir')
protocols = [[wl_protocol_dir, 'stable/presentation-time/presentation-time.xml'],
[wl_protocol_dir, 'stable/viewporter/viewporter.xml'],
[wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'],
[wl_protocol_dir, 'unstable/idle-inhibit/idle-inhibit-unstable-v1.xml'],
[wl_protocol_dir, 'unstable/text-input/text-input-unstable-v3.xml'],
[wl_protocol_dir, 'unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml'],
[wl_protocol_dir, 'unstable/xdg-decoration/xdg-decoration-unstable-v1.xml'],
[wl_protocol_dir, 'staging/content-type/content-type-v1.xml'],
[wl_protocol_dir, 'staging/fractional-scale/fractional-scale-v1.xml'],
[wl_protocol_dir, 'staging/single-pixel-buffer/single-pixel-buffer-v1.xml'],
['protocols', 'xx-color-management-v4.xml']]
wl_protocols_source = []
wl_protocols_headers = []
foreach v: ['1.32', '1.39']
features += {'wayland-protocols-' + v.replace('.', '-'):
wayland['deps'][2].version().version_compare('>=' + v)}
endforeach
if features['wayland-protocols-1-32']
protocols += [[wl_protocol_dir, 'staging/cursor-shape/cursor-shape-v1.xml'],
[wl_protocol_dir, 'unstable/tablet/tablet-unstable-v2.xml']] # required by cursor-shape
endif
if features['wayland-protocols-1-39']
protocols += [[wl_protocol_dir, 'staging/ext-data-control/ext-data-control-v1.xml']]
endif
foreach p: protocols
xml = join_paths(p)
wl_protocols_source += custom_target(xml.underscorify() + '_c',
input: xml,
output: '@BASENAME@.c',
command: [wayland['scanner'], 'private-code', '@INPUT@', '@OUTPUT@'],
)
wl_protocols_headers += custom_target(xml.underscorify() + '_h',
input: xml,
output: '@BASENAME@.h',
command: [wayland['scanner'], 'client-header', '@INPUT@', '@OUTPUT@'],
)
endforeach
lib_client_protocols = static_library('protocols',
wl_protocols_source + wl_protocols_headers,
dependencies: wayland['deps'][0])
client_protocols = declare_dependency(link_with: lib_client_protocols,
sources: wl_protocols_headers)
dependencies += [client_protocols, wayland['deps']]
sources += files('wayland_common.c')