YaLTeR / wl-clipboard-rs

A safe Rust crate for working with the Wayland clipboard.
Apache License 2.0
223 stars 16 forks source link

Error: Wayland compositor communication error #34

Closed planetoryd closed 1 year ago

planetoryd commented 1 year ago
[1676066644.193761] -> wl_display@1.get_registry(2)
[1676066644.193784] -> wl_display@1.sync(3)
[1676066644.198184] <- wl_display@1.delete_id(3)
[1676066644.198200] <- wl_registry@2.global(1, "wl_compositor", 5)
[1676066644.198243] <- wl_registry@2.global(2, "zwp_tablet_manager_v2", 1)
[1676066644.198279] <- wl_registry@2.global(3, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[1676066644.198326] <- wl_registry@2.global(5, "xdg_wm_base", 4)
[1676066644.198357] <- wl_registry@2.global(6, "zwlr_layer_shell_v1", 3)
[1676066644.198391] <- wl_registry@2.global(7, "zxdg_decoration_manager_v1", 1)
[1676066644.198428] <- wl_registry@2.global(8, "wp_viewporter", 1)
[1676066644.198458] <- wl_registry@2.global(9, "wl_shm", 1)
[1676066644.198481] <- wl_registry@2.global(10, "wl_seat", 7)
[1676066644.198512] -> wl_registry@2.bind(10, "wl_seat", 7, 4)
[1676066644.198551] <- wl_registry@2.global(11, "zwp_pointer_gestures_v1", 3)
[1676066644.198586] <- wl_registry@2.global(12, "zwp_pointer_constraints_v1", 1)
[1676066644.198624] <- wl_registry@2.global(13, "zwp_relative_pointer_manager_v1", 1)
[1676066644.198664] <- wl_registry@2.global(14, "wl_data_device_manager", 3)
[1676066644.198697] <- wl_registry@2.global(15, "zwlr_data_control_manager_v1", 2)
[1676066644.198733] <- wl_registry@2.global(16, "zwp_primary_selection_device_manager_v1", 1)
[1676066644.198769] <- wl_registry@2.global(17, "org_kde_kwin_idle", 1)
[1676066644.198793] <- wl_registry@2.global(18, "zwp_idle_inhibit_manager_v1", 1)
[1676066644.198826] <- wl_registry@2.global(19, "org_kde_plasma_shell", 7)
[1676066644.198853] <- wl_registry@2.global(20, "org_kde_kwin_appmenu_manager", 1)
[1676066644.198882] <- wl_registry@2.global(21, "org_kde_kwin_server_decoration_palette_manager", 1)
[1676066644.198918] <- wl_registry@2.global(23, "org_kde_plasma_virtual_desktop_management", 2)
[1676066644.198953] <- wl_registry@2.global(25, "org_kde_kwin_shadow_manager", 2)
[1676066644.198980] <- wl_registry@2.global(26, "org_kde_kwin_dpms_manager", 1)
[1676066644.199008] <- wl_registry@2.global(27, "org_kde_kwin_server_decoration_manager", 1)
[1676066644.199042] <- wl_registry@2.global(28, "kde_output_management_v2", 2)
[1676066644.199070] <- wl_registry@2.global(29, "kde_primary_output_v1", 2)
[1676066644.199097] <- wl_registry@2.global(30, "zxdg_output_manager_v1", 3)
[1676066644.199125] <- wl_registry@2.global(31, "wl_subcompositor", 1)
[1676066644.199151] <- wl_registry@2.global(32, "zxdg_exporter_v2", 1)
[1676066644.199174] <- wl_registry@2.global(33, "zxdg_importer_v2", 1)
[1676066644.199197] <- wl_registry@2.global(35, "xdg_activation_v1", 1)
[1676066644.199221] <- wl_registry@2.global(36, "wp_drm_lease_device_v1", 1)
[1676066644.199255] <- wl_registry@2.global(39, "wl_drm", 2)
[1676066644.199274] <- wl_registry@2.global(40, "zwp_linux_dmabuf_v1", 4)
[1676066644.199300] <- wl_registry@2.global(44, "zwp_text_input_manager_v2", 1)
[1676066644.199327] <- wl_registry@2.global(45, "zwp_text_input_manager_v3", 1)
[1676066644.199355] <- wl_registry@2.global(46, "org_kde_kwin_contrast_manager", 2)
[1676066644.199384] <- wl_registry@2.global(47, "org_kde_kwin_blur_manager", 1)
[1676066644.199413] <- wl_registry@2.global(48, "org_kde_kwin_slide_manager", 1)
[1676066644.199444] <- wl_registry@2.global(49, "kde_output_device_v2", 2)
[1676066644.199469] <- wl_registry@2.global(50, "wl_output", 3)
[1676066644.199490] <- wl_callback@3.done(69055)
[1676066644.199515] -> wl_registry@2.bind(15, "zwlr_data_control_manager_v1", 1, 3)
[1676066644.199557] -> zwlr_data_control_manager_v1@3.get_data_device(5, 4)
[1676066644.199583] -> wl_display@1.sync(6)
[1676066644.199755] <- wl_display@1.delete_id(6)
[1676066644.199770] <- wl_seat@4.capabilities(7)
[1676066644.199787] <- wl_seat@4.name("")
[1676066644.199805] <- zwlr_data_control_device_v1@5.data_offer(4278190080)
[1676066644.199830] <- zwlr_data_control_offer_v1@4278190080.offer("TIMESTAMP")
[1676066644.199856] <- zwlr_data_control_offer_v1@4278190080.offer("TARGETS")
[1676066644.199874] <- zwlr_data_control_offer_v1@4278190080.offer("MULTIPLE")
[1676066644.199890] <- zwlr_data_control_offer_v1@4278190080.offer("SAVE_TARGETS")
[1676066644.199918] <- zwlr_data_control_offer_v1@4278190080.offer("text/html")
[1676066644.199938] <- zwlr_data_control_offer_v1@4278190080.offer("text/_moz_htmlcontext")
[1676066644.199961] <- zwlr_data_control_offer_v1@4278190080.offer("text/_moz_htmlinfo")
[1676066644.199984] <- zwlr_data_control_offer_v1@4278190080.offer("text/plain;charset=utf-8")
[1676066644.200012] <- zwlr_data_control_offer_v1@4278190080.offer("COMPOUND_TEXT")
[1676066644.200032] <- zwlr_data_control_offer_v1@4278190080.offer("text/plain")
[1676066644.200052] <- zwlr_data_control_offer_v1@4278190080.offer("STRING")
[1676066644.200070] <- zwlr_data_control_offer_v1@4278190080.offer("text/plain;charset=utf-8")
[1676066644.200095] <- zwlr_data_control_offer_v1@4278190080.offer("text/plain;charset=ANSI_X3.4-1968")
[1676066644.200125] <- zwlr_data_control_offer_v1@4278190080.offer("text/plain")
[1676066644.200145] <- zwlr_data_control_offer_v1@4278190080.offer("text/x-moz-url-priv")
[1676066644.200167] <- zwlr_data_control_device_v1@5.selection(4278190080)
[1676066644.200183] <- zwlr_data_control_device_v1@5.data_offer(4278190081)
[1676066644.200200] <- zwlr_data_control_offer_v1@4278190081.offer("TIMESTAMP")
[1676066644.200221] <- zwlr_data_control_offer_v1@4278190081.offer("TARGETS")
[1676066644.200236] <- zwlr_data_control_offer_v1@4278190081.offer("MULTIPLE")
[1676066644.200253] <- zwlr_data_control_offer_v1@4278190081.offer("text/html")
[1676066644.200275] <- zwlr_data_control_offer_v1@4278190081.offer("text/_moz_htmlcontext")
[1676066644.200298] <- zwlr_data_control_offer_v1@4278190081.offer("text/_moz_htmlinfo")
[1676066644.200321] <- zwlr_data_control_offer_v1@4278190081.offer("text/plain;charset=utf-8")
[1676066644.200346] <- zwlr_data_control_offer_v1@4278190081.offer("COMPOUND_TEXT")
[1676066644.200371] <- zwlr_data_control_offer_v1@4278190081.offer("text/plain")
[1676066644.200390] <- zwlr_data_control_offer_v1@4278190081.offer("STRING")
[1676066644.200407] <- zwlr_data_control_offer_v1@4278190081.offer("text/plain;charset=utf-8")
[1676066644.200432] <- zwlr_data_control_offer_v1@4278190081.offer("text/plain;charset=ANSI_X3.4-1968")
[1676066644.200462] <- zwlr_data_control_offer_v1@4278190081.offer("text/plain")
[1676066644.200481] <- zwlr_data_control_offer_v1@4278190081.offer("text/x-moz-url-priv")
[1676066644.200504] <- zwlr_data_control_device_v1@5.primary_selection(4278190081)
Received an event primary_selection requiring version >= 2 while proxy zwlr_data_control_device_v1@5 is version 1.
Error: Wayland compositor communication error

Caused by:
    Dispatch for object zwlr_data_control_device_v1@5 errored.

on kubuntu 22.10

YaLTeR commented 1 year ago

This looks like a bug in the compositor. wl-clipboard-rs is requesting zwlr_data_control_manager_v1 version 1, but then the compositor sends it an event that was added only in version 2.

planetoryd commented 1 year ago

and https://github.com/bugaevc/wl-clipboard this works without problem

YaLTeR commented 1 year ago

It might be the case that wl-clipboard always requests zwlr_data_control_manager_v1 version 2, or perhaps the C implementation does not have this strict check? Do you mind posting wl-clipboard's WAYLAND_DEBUG log?

planetoryd commented 1 year ago
➜  ~ WAYLAND_DEBUG=1 wl-paste -p
[ 838312.848]  -> wl_display@1.get_registry(new id wl_registry@2)
[ 838312.858]  -> wl_display@1.sync(new id wl_callback@3)
[ 838316.177] wl_display@1.delete_id(3)
[ 838316.188] wl_registry@2.global(1, "wl_compositor", 5)
[ 838316.193]  -> wl_registry@2.bind(1, "wl_compositor", 2, new id [unknown]@4)
[ 838316.199] wl_registry@2.global(2, "zwp_tablet_manager_v2", 1)
[ 838316.204] wl_registry@2.global(3, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[ 838316.209] wl_registry@2.global(5, "xdg_wm_base", 4)
[ 838316.215]  -> wl_registry@2.bind(5, "xdg_wm_base", 1, new id [unknown]@5)
[ 838316.221] wl_registry@2.global(6, "zwlr_layer_shell_v1", 3)
[ 838316.226] wl_registry@2.global(7, "zxdg_decoration_manager_v1", 1)
[ 838316.231] wl_registry@2.global(8, "wp_viewporter", 1)
[ 838316.236] wl_registry@2.global(9, "wl_shm", 1)
[ 838316.241]  -> wl_registry@2.bind(9, "wl_shm", 1, new id [unknown]@6)
[ 838316.247] wl_registry@2.global(10, "wl_seat", 7)
[ 838316.254]  -> wl_registry@2.bind(10, "wl_seat", 2, new id [unknown]@7)
[ 838316.259] wl_registry@2.global(11, "zwp_pointer_gestures_v1", 3)
[ 838316.265] wl_registry@2.global(12, "zwp_pointer_constraints_v1", 1)
[ 838316.268] wl_registry@2.global(13, "zwp_relative_pointer_manager_v1", 1)
[ 838316.273] wl_registry@2.global(14, "wl_data_device_manager", 3)
[ 838316.279]  -> wl_registry@2.bind(14, "wl_data_device_manager", 1, new id [unknown]@8)
[ 838316.284] wl_registry@2.global(15, "zwlr_data_control_manager_v1", 2)
[ 838316.289]  -> wl_registry@2.bind(15, "zwlr_data_control_manager_v1", 2, new id [unknown]@9)
[ 838316.294] wl_registry@2.global(16, "zwp_primary_selection_device_manager_v1", 1)
[ 838316.298]  -> wl_registry@2.bind(16, "zwp_primary_selection_device_manager_v1", 1, new id [unknown]@10)
[ 838316.303] wl_registry@2.global(17, "org_kde_kwin_idle", 1)
[ 838316.308] wl_registry@2.global(18, "zwp_idle_inhibit_manager_v1", 1)
[ 838316.312] wl_registry@2.global(19, "org_kde_plasma_shell", 7)
[ 838316.318] wl_registry@2.global(20, "org_kde_kwin_appmenu_manager", 1)
[ 838316.323] wl_registry@2.global(21, "org_kde_kwin_server_decoration_palette_manager", 1)
[ 838316.328] wl_registry@2.global(23, "org_kde_plasma_virtual_desktop_management", 2)
[ 838316.335] wl_registry@2.global(25, "org_kde_kwin_shadow_manager", 2)
[ 838316.340] wl_registry@2.global(26, "org_kde_kwin_dpms_manager", 1)
[ 838316.344] wl_registry@2.global(27, "org_kde_kwin_server_decoration_manager", 1)
[ 838316.348] wl_registry@2.global(28, "kde_output_management_v2", 2)
[ 838316.355] wl_registry@2.global(29, "kde_primary_output_v1", 2)
[ 838316.361] wl_registry@2.global(30, "zxdg_output_manager_v1", 3)
[ 838316.366] wl_registry@2.global(31, "wl_subcompositor", 1)
[ 838316.370] wl_registry@2.global(32, "zxdg_exporter_v2", 1)
[ 838316.375] wl_registry@2.global(33, "zxdg_importer_v2", 1)
[ 838316.382] wl_registry@2.global(35, "xdg_activation_v1", 1)
[ 838316.386] wl_registry@2.global(36, "wp_drm_lease_device_v1", 1)
[ 838316.391] wl_registry@2.global(39, "wl_drm", 2)
[ 838316.395] wl_registry@2.global(40, "zwp_linux_dmabuf_v1", 4)
[ 838316.400] wl_registry@2.global(44, "zwp_text_input_manager_v2", 1)
[ 838316.405] wl_registry@2.global(45, "zwp_text_input_manager_v3", 1)
[ 838316.411] wl_registry@2.global(46, "org_kde_kwin_contrast_manager", 2)
[ 838316.416] wl_registry@2.global(47, "org_kde_kwin_blur_manager", 1)
[ 838316.421] wl_registry@2.global(48, "org_kde_kwin_slide_manager", 1)
[ 838316.425] wl_registry@2.global(49, "kde_output_device_v2", 2)
[ 838316.430] wl_registry@2.global(50, "wl_output", 3)
[ 838316.434] wl_callback@3.done(73899)
[ 838316.440]  -> wl_display@1.sync(new id wl_callback@3)
[ 838316.516] wl_display@1.delete_id(3)
[ 838316.531] wl_seat@7.capabilities(7)
[ 838316.536] wl_seat@7.name("")
[ 838316.540] wl_callback@3.done(73899)
[ 838316.546]  -> zwlr_data_control_manager_v1@9.get_data_device(new id zwlr_data_control_device_v1@3, wl_seat@7)
[ 838316.552]  -> wl_display@1.sync(new id wl_callback@11)
[ 838316.639] wl_display@1.delete_id(11)
[ 838316.648] zwlr_data_control_device_v1@3.data_offer(new id zwlr_data_control_offer_v1@4278190080)
[ 838316.653] zwlr_data_control_offer_v1@4278190080.offer("TIMESTAMP")
[ 838316.657] zwlr_data_control_offer_v1@4278190080.offer("TARGETS")
[ 838316.662] zwlr_data_control_offer_v1@4278190080.offer("MULTIPLE")
[ 838316.666] zwlr_data_control_offer_v1@4278190080.offer("SAVE_TARGETS")
[ 838316.671] zwlr_data_control_offer_v1@4278190080.offer("text/html")
[ 838316.675] zwlr_data_control_offer_v1@4278190080.offer("text/_moz_htmlcontext")
[ 838316.680] zwlr_data_control_offer_v1@4278190080.offer("text/_moz_htmlinfo")
[ 838316.684] zwlr_data_control_offer_v1@4278190080.offer("text/plain;charset=utf-8")
[ 838316.690] zwlr_data_control_offer_v1@4278190080.offer("COMPOUND_TEXT")
[ 838316.694] zwlr_data_control_offer_v1@4278190080.offer("text/plain")
[ 838316.699] zwlr_data_control_offer_v1@4278190080.offer("STRING")
[ 838316.704] zwlr_data_control_offer_v1@4278190080.offer("text/plain;charset=utf-8")
[ 838316.709] zwlr_data_control_offer_v1@4278190080.offer("text/plain;charset=ANSI_X3.4-1968")
[ 838316.713] zwlr_data_control_offer_v1@4278190080.offer("text/plain")
[ 838316.718] zwlr_data_control_offer_v1@4278190080.offer("text/x-moz-url-priv")
[ 838316.722] zwlr_data_control_device_v1@3.selection(zwlr_data_control_offer_v1@4278190080)
[ 838316.728]  -> zwlr_data_control_offer_v1@4278190080.destroy()
[ 838316.733] zwlr_data_control_device_v1@3.data_offer(new id zwlr_data_control_offer_v1@4278190081)
[ 838316.737] zwlr_data_control_offer_v1@4278190081.offer("TIMESTAMP")
[ 838316.742] zwlr_data_control_offer_v1@4278190081.offer("TARGETS")
[ 838316.746] zwlr_data_control_offer_v1@4278190081.offer("MULTIPLE")
[ 838316.751] zwlr_data_control_offer_v1@4278190081.offer("text/html")
[ 838316.756] zwlr_data_control_offer_v1@4278190081.offer("text/_moz_htmlcontext")
[ 838316.760] zwlr_data_control_offer_v1@4278190081.offer("text/_moz_htmlinfo")
[ 838316.765] zwlr_data_control_offer_v1@4278190081.offer("text/plain;charset=utf-8")
[ 838316.770] zwlr_data_control_offer_v1@4278190081.offer("COMPOUND_TEXT")
[ 838316.774] zwlr_data_control_offer_v1@4278190081.offer("text/plain")
[ 838316.779] zwlr_data_control_offer_v1@4278190081.offer("STRING")
[ 838316.784] zwlr_data_control_offer_v1@4278190081.offer("text/plain;charset=utf-8")
[ 838316.787] zwlr_data_control_offer_v1@4278190081.offer("text/plain;charset=ANSI_X3.4-1968")
[ 838316.792] zwlr_data_control_offer_v1@4278190081.offer("text/plain")
[ 838316.796] zwlr_data_control_offer_v1@4278190081.offer("text/x-moz-url-priv")
[ 838316.800] zwlr_data_control_device_v1@3.primary_selection(zwlr_data_control_offer_v1@4278190081)
[ 838316.815]  -> zwlr_data_control_offer_v1@4278190081.receive("text/plain;charset=utf-8", fd 12)
[ 838316.821]  -> wl_display@1.sync(new id wl_callback@12)
[ 838316.827] wl_callback@11.done(73899)
[ 838316.904] wl_display@1.delete_id(12)
[ 838316.914] wl_callback@12.done(73899)
WAYLAND_DEBUG
[ 838317.566]  -> zwlr_data_control_offer_v1@4278190081.destroy()
YaLTeR commented 1 year ago

Yeah, you can see it binds version 2:

[ 838316.289]  -> wl_registry@2.bind(15, "zwlr_data_control_manager_v1", 2, new id [unknown]@9)

whereas wl-clipboard-rs binds version 1:

[1676066644.199515] -> wl_registry@2.bind(15, "zwlr_data_control_manager_v1", 1, 3)

and version 1 does not have the primary clipboard event, so the compositor shouldn't send it.

planetoryd commented 1 year ago

https://bugs.kde.org/show_bug.cgi?id=465657

YaLTeR commented 1 year ago

Thanks!