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

Implement hack/workaround for missing wlr-data-control #39

Open
jarod opened this issue Nov 11, 2023 · 4 comments
Open

Implement hack/workaround for missing wlr-data-control #39

jarod opened this issue Nov 11, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@jarod
Copy link

jarod commented Nov 11, 2023

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 23.10
Release:        23.10
Codename:       mantic

$ echo "$XDG_SESSION_TYPE"
wayland

$ wl-copy --version
wl-copy 0.8.0

$ echo "test" | WAYLAND_DEBUG=1 ./wl-copy
[1699667777.010009] -> wl_display@1.get_registry (wl_registry@2)
[1699667777.010185] -> wl_display@1.sync (wl_callback@3)
[1699667777.010765] <- wl_registry@2.global, (1, Some("wl_compositor"), 5)
[1699667777.011061] <- wl_registry@2.global, (2, Some("wl_drm"), 2)
[1699667777.011369] <- wl_registry@2.global, (3, Some("wl_shm"), 1)
[1699667777.011578] <- wl_registry@2.global, (4, Some("wl_output"), 4)
[1699667777.011810] <- wl_registry@2.global, (5, Some("zxdg_output_manager_v1"), 3)
[1699667777.012101] <- wl_registry@2.global, (6, Some("wl_data_device_manager"), 3)
[1699667777.012395] <- wl_registry@2.global, (7, Some("zwp_primary_selection_device_manager_v1"), 1)
[1699667777.012876] <- wl_registry@2.global, (8, Some("wl_subcompositor"), 1)
[1699667777.013146] <- wl_registry@2.global, (9, Some("xdg_wm_base"), 6)
[1699667777.013386] <- wl_registry@2.global, (10, Some("gtk_shell1"), 5)
[1699667777.013611] <- wl_registry@2.global, (11, Some("wp_viewporter"), 1)
[1699667777.013843] <- wl_registry@2.global, (12, Some("wp_fractional_scale_manager_v1"), 1)
[1699667777.014208] <- wl_registry@2.global, (13, Some("zwp_pointer_gestures_v1"), 3)
[1699667777.014514] <- wl_registry@2.global, (14, Some("zwp_tablet_manager_v2"), 1)
[1699667777.014815] <- wl_registry@2.global, (15, Some("wl_seat"), 8)
[1699667777.015022] <- wl_registry@2.global, (16, Some("zwp_relative_pointer_manager_v1"), 1)
[1699667777.015646] <- wl_registry@2.global, (17, Some("zwp_pointer_constraints_v1"), 1)
[1699667777.016015] <- wl_registry@2.global, (18, Some("zxdg_exporter_v2"), 1)
[1699667777.016283] <- wl_registry@2.global, (19, Some("zxdg_importer_v2"), 1)
[1699667777.016544] <- wl_registry@2.global, (20, Some("zxdg_exporter_v1"), 1)
[1699667777.016811] <- wl_registry@2.global, (21, Some("zxdg_importer_v1"), 1)
[1699667777.017076] <- wl_registry@2.global, (22, Some("zwp_linux_dmabuf_v1"), 4)
[1699667777.017357] <- wl_registry@2.global, (23, Some("wp_single_pixel_buffer_manager_v1"), 1)
[1699667777.017741] <- wl_registry@2.global, (24, Some("zwp_keyboard_shortcuts_inhibit_manager_v1"), 1)
[1699667777.018166] <- wl_registry@2.global, (25, Some("zwp_text_input_manager_v3"), 1)
[1699667777.018511] <- wl_registry@2.global, (26, Some("wp_presentation"), 1)
[1699667777.018768] <- wl_registry@2.global, (27, Some("xdg_activation_v1"), 1)
[1699667777.019035] <- wl_registry@2.global, (28, Some("zwp_idle_inhibit_manager_v1"), 1)
[1699667777.019426] <- wl_callback@3.done, (2857)
[1699667777.019544] <- wl_display@1.delete_id, (3)
Error: A required Wayland protocol (zwlr_data_control_manager_v1 version 1) is not supported by the compositor

while wl-clipboard 2.2.0 works fine on the same system.

@YaLTeR
Copy link
Owner

YaLTeR commented Nov 11, 2023

I'm guessing this is GNOME? It is expected that wl-clipboard-rs doesn't work there since mutter doesn't implement the wlr-data-control protocol. The way wl-clipboard works is with a hack where it spawns a 1x1 window for a splitsecond, then relies on the compositor to give it focus automatically, and uses the standard Wayland clipboard protocol. This hack is not implemented in wl-clipboard-rs.

@jarod
Copy link
Author

jarod commented Nov 11, 2023

I'm guessing this is GNOME? It is expected that wl-clipboard-rs doesn't work there since mutter doesn't implement the wlr-data-control protocol. The way wl-clipboard works is with a hack where it spawns a 1x1 window for a splitsecond, then relies on the compositor to give it focus automatically, and uses the standard Wayland clipboard protocol. This hack is not implemented in wl-clipboard-rs.

Thanks for explaining the cause. My machine is running on Ubuntu with GNOME.
Is there a plan to implement the hack for wl-clipboard-rs? it will making wl-clipboard-rs a more useful tool.

@YaLTeR
Copy link
Owner

YaLTeR commented Nov 11, 2023

No concrete plans.

@YaLTeR YaLTeR changed the title wl-clipboard-rs-tools: zwlr_data_control_manager_v1 is not supported by the compositor Implement hack/workaround for missing wlr-data-control Nov 29, 2023
@YaLTeR YaLTeR added the enhancement New feature or request label Nov 29, 2023
@thiagokokada
Copy link

Same issue with Crostini (Linux VMs in ChromeOS), and yes, wl-clipboard works fine there.

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

No branches or pull requests

3 participants