YaLTeR / wl-clipboard-rs

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

weird behaviour when trying to copy to clipboard #45

Closed 0x5a4 closed 3 weeks ago

0x5a4 commented 3 weeks ago

I'm trying to copy some text into the clipboard and am experiencing some quite weird behaviour. wl-clipboard-rs

Im on hyprland-0.41.2, wl-clipboard-rs-0.9.0

WAYLAND_DEBUG of setting the clipboard contents

``` [3161487.609][rs] -> wl_display@1.get_registry(wl_registry@2) [3161487.656][rs] -> wl_display@1.sync(wl_callback@3) [3161487.780][rs] <- wl_registry@2.global, (1, Some("wl_seat"), 9) [3161487.840][rs] <- wl_registry@2.global, (2, Some("wl_data_device_manager"), 3) [3161487.888][rs] <- wl_registry@2.global, (3, Some("wl_compositor"), 6) [3161487.953][rs] <- wl_registry@2.global, (4, Some("wl_subcompositor"), 1) [3161488.017][rs] <- wl_registry@2.global, (5, Some("wl_shm"), 1) [3161488.096][rs] <- wl_registry@2.global, (6, Some("wp_viewporter"), 1) [3161488.166][rs] <- wl_registry@2.global, (7, Some("wp_tearing_control_manager_v1"), 1) [3161488.264][rs] <- wl_registry@2.global, (8, Some("wp_fractional_scale_manager_v1"), 1) [3161488.372][rs] <- wl_registry@2.global, (9, Some("zxdg_output_manager_v1"), 3) [3161488.445][rs] <- wl_registry@2.global, (10, Some("wp_cursor_shape_manager_v1"), 1) [3161488.545][rs] <- wl_registry@2.global, (11, Some("zwp_idle_inhibit_manager_v1"), 1) [3161488.647][rs] <- wl_registry@2.global, (12, Some("zwp_relative_pointer_manager_v1"), 1) [3161488.767][rs] <- wl_registry@2.global, (13, Some("zxdg_decoration_manager_v1"), 1) [3161488.865][rs] <- wl_registry@2.global, (14, Some("wp_alpha_modifier_v1"), 1) [3161488.963][rs] <- wl_registry@2.global, (15, Some("zwlr_gamma_control_manager_v1"), 1) [3161489.058][rs] <- wl_registry@2.global, (16, Some("ext_foreign_toplevel_list_v1"), 1) [3161489.170][rs] <- wl_registry@2.global, (17, Some("zwp_pointer_gestures_v1"), 3) [3161489.263][rs] <- wl_registry@2.global, (18, Some("zwlr_foreign_toplevel_manager_v1"), 3) [3161489.393][rs] <- wl_registry@2.global, (19, Some("zwp_keyboard_shortcuts_inhibit_manager_v1"), 1) [3161489.525][rs] <- wl_registry@2.global, (20, Some("zwp_text_input_manager_v3"), 1) [3161489.626][rs] <- wl_registry@2.global, (21, Some("zwp_pointer_constraints_v1"), 1) [3161489.738][rs] <- wl_registry@2.global, (22, Some("zwlr_output_power_manager_v1"), 1) [3161489.845][rs] <- wl_registry@2.global, (23, Some("xdg_activation_v1"), 1) [3161489.950][rs] <- wl_registry@2.global, (24, Some("ext_idle_notifier_v1"), 1) [3161490.060][rs] <- wl_registry@2.global, (25, Some("ext_session_lock_manager_v1"), 1) [3161490.188][rs] <- wl_registry@2.global, (26, Some("zwp_input_method_manager_v2"), 1) [3161490.346][rs] <- wl_registry@2.global, (27, Some("zwp_virtual_keyboard_manager_v1"), 1) [3161490.489][rs] <- wl_registry@2.global, (28, Some("zwlr_virtual_pointer_manager_v1"), 2) [3161490.624][rs] <- wl_registry@2.global, (29, Some("zwlr_output_manager_v1"), 4) [3161490.752][rs] <- wl_registry@2.global, (30, Some("org_kde_kwin_server_decoration_manager"), 1) [3161490.904][rs] <- wl_registry@2.global, (31, Some("hyprland_focus_grab_manager_v1"), 1) [3161491.031][rs] <- wl_registry@2.global, (32, Some("zwp_tablet_manager_v2"), 1) [3161491.140][rs] <- wl_registry@2.global, (33, Some("zwlr_layer_shell_v1"), 5) [3161491.239][rs] <- wl_registry@2.global, (34, Some("wp_presentation"), 1) [3161491.370][rs] <- wl_registry@2.global, (35, Some("xdg_wm_base"), 6) [3161491.443][rs] <- wl_registry@2.global, (36, Some("zwlr_data_control_manager_v1"), 2) [3161491.551][rs] <- wl_registry@2.global, (37, Some("zwp_primary_selection_device_manager_v1"), 1) [3161491.693][rs] <- wl_registry@2.global, (38, Some("xwayland_shell_v1"), 1) [3161491.807][rs] <- wl_registry@2.global, (39, Some("wl_drm"), 2) [3161491.889][rs] <- wl_registry@2.global, (40, Some("zwp_linux_dmabuf_v1"), 5) [3161491.997][rs] <- wl_registry@2.global, (41, Some("hyprland_toplevel_export_manager_v1"), 2) [3161492.141][rs] <- wl_registry@2.global, (42, Some("zwp_text_input_manager_v1"), 1) [3161492.270][rs] <- wl_registry@2.global, (43, Some("hyprland_global_shortcuts_manager_v1"), 1) [3161492.465][rs] <- wl_registry@2.global, (44, Some("zwlr_screencopy_manager_v1"), 3) [3161492.610][rs] <- wl_registry@2.global, (45, Some("wp_drm_lease_device_v1"), 1) [3161492.727][rs] <- wl_registry@2.global, (46, Some("wl_output"), 4) [3161492.804][rs] <- wl_callback@3.done, (11881) [3161492.847][rs] <- wl_display@1.delete_id, (3) [3161492.926][rs] -> wl_registry@2.bind(36, Some("zwlr_data_control_manager_v1"), 1, zwlr_data_control_manager_v1@3) [3161493.079][rs] -> wl_registry@2.bind(1, Some("wl_seat"), 2, wl_seat@4) [3161493.203][rs] -> zwlr_data_control_manager_v1@3.get_data_device(zwlr_data_control_device_v1@5, wl_seat@4) [3161493.262][rs] -> wl_display@1.sync(wl_callback@6) [3161493.569][rs] <- wl_seat@4.name, (Some("Hyprland")) [3161493.695][rs] <- wl_seat@4.capabilities, (3) [3161493.763][rs] <- zwlr_data_control_device_v1@5.data_offer, (zwlr_data_control_offer_v1@4278190080) [3161493.825][rs] <- zwlr_data_control_offer_v1@4278190080.offer, (Some("text/plain")) [3161493.924][rs] <- zwlr_data_control_offer_v1@4278190080.offer, (Some("text/plain")) [3161494.034][rs] <- zwlr_data_control_offer_v1@4278190080.offer, (Some("text/plain;charset=utf-8")) [3161494.163][rs] <- zwlr_data_control_offer_v1@4278190080.offer, (Some("TEXT")) [3161494.240][rs] <- zwlr_data_control_offer_v1@4278190080.offer, (Some("STRING")) [3161494.332][rs] <- zwlr_data_control_offer_v1@4278190080.offer, (Some("UTF8_STRING")) [3161494.438][rs] <- zwlr_data_control_device_v1@5.selection, (zwlr_data_control_offer_v1@4278190080) [3161494.495][rs] <- zwlr_data_control_device_v1@5.primary_selection, (@0) [3161494.550][rs] <- wl_callback@6.done, (11881) [3161494.595][rs] <- wl_display@1.delete_id, (6) [3161494.719][rs] -> zwlr_data_control_offer_v1@4278190080.destroy() [3161495.584][rs] -> zwlr_data_control_manager_v1@3.create_data_source(zwlr_data_control_source_v1@6) [3161495.676][rs] -> zwlr_data_control_source_v1@6.offer(Some("text/plain;charset=utf-8")) [3161495.811][rs] -> zwlr_data_control_source_v1@6.offer(Some("UTF8_STRING")) [3161495.915][rs] -> zwlr_data_control_source_v1@6.offer(Some("text/plain")) [3161496.016][rs] -> zwlr_data_control_source_v1@6.offer(Some("STRING")) [3161496.119][rs] -> zwlr_data_control_source_v1@6.offer(Some("TEXT")) [3161496.209][rs] -> zwlr_data_control_device_v1@5.set_selection(zwlr_data_control_source_v1@6) ```

running wl-paste afterwards

``` [3252756.365] -> wl_display@1.get_registry(new id wl_registry@2) [3252756.393] -> wl_display@1.sync(new id wl_callback@3) [3252759.043] wl_display@1.delete_id(3) [3252759.062] wl_registry@2.global(1, "wl_seat", 9) [3252759.076] -> wl_registry@2.bind(1, "wl_seat", 2, new id [unknown]@4) [3252759.090] wl_registry@2.global(2, "wl_data_device_manager", 3) [3252759.099] -> wl_registry@2.bind(2, "wl_data_device_manager", 1, new id [unknown]@5) [3252759.109] wl_registry@2.global(3, "wl_compositor", 6) [3252759.116] -> wl_registry@2.bind(3, "wl_compositor", 2, new id [unknown]@6) [3252759.124] wl_registry@2.global(4, "wl_subcompositor", 1) [3252759.131] wl_registry@2.global(5, "wl_shm", 1) [3252759.141] -> wl_registry@2.bind(5, "wl_shm", 1, new id [unknown]@7) [3252759.149] wl_registry@2.global(6, "wp_viewporter", 1) [3252759.156] wl_registry@2.global(7, "wp_tearing_control_manager_v1", 1) [3252759.163] wl_registry@2.global(8, "wp_fractional_scale_manager_v1", 1) [3252759.170] wl_registry@2.global(9, "zxdg_output_manager_v1", 3) [3252759.178] wl_registry@2.global(10, "wp_cursor_shape_manager_v1", 1) [3252759.184] wl_registry@2.global(11, "zwp_idle_inhibit_manager_v1", 1) [3252759.191] wl_registry@2.global(12, "zwp_relative_pointer_manager_v1", 1) [3252759.198] wl_registry@2.global(13, "zxdg_decoration_manager_v1", 1) [3252759.205] wl_registry@2.global(14, "wp_alpha_modifier_v1", 1) [3252759.212] wl_registry@2.global(15, "zwlr_gamma_control_manager_v1", 1) [3252759.219] wl_registry@2.global(16, "ext_foreign_toplevel_list_v1", 1) [3252759.227] wl_registry@2.global(17, "zwp_pointer_gestures_v1", 3) [3252759.234] wl_registry@2.global(18, "zwlr_foreign_toplevel_manager_v1", 3) [3252759.242] wl_registry@2.global(19, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1) [3252759.249] wl_registry@2.global(20, "zwp_text_input_manager_v3", 1) [3252759.257] wl_registry@2.global(21, "zwp_pointer_constraints_v1", 1) [3252759.264] wl_registry@2.global(22, "zwlr_output_power_manager_v1", 1) [3252759.271] wl_registry@2.global(23, "xdg_activation_v1", 1) [3252759.279] -> wl_registry@2.bind(23, "xdg_activation_v1", 1, new id [unknown]@8) [3252759.287] wl_registry@2.global(24, "ext_idle_notifier_v1", 1) [3252759.294] wl_registry@2.global(25, "ext_session_lock_manager_v1", 1) [3252759.301] wl_registry@2.global(26, "zwp_input_method_manager_v2", 1) [3252759.318] wl_registry@2.global(27, "zwp_virtual_keyboard_manager_v1", 1) [3252759.326] wl_registry@2.global(28, "zwlr_virtual_pointer_manager_v1", 2) [3252759.333] wl_registry@2.global(29, "zwlr_output_manager_v1", 4) [3252759.340] wl_registry@2.global(30, "org_kde_kwin_server_decoration_manager", 1) [3252759.348] wl_registry@2.global(31, "hyprland_focus_grab_manager_v1", 1) [3252759.355] wl_registry@2.global(32, "zwp_tablet_manager_v2", 1) [3252759.363] wl_registry@2.global(33, "zwlr_layer_shell_v1", 5) [3252759.370] wl_registry@2.global(34, "wp_presentation", 1) [3252759.377] wl_registry@2.global(35, "xdg_wm_base", 6) [3252759.385] -> wl_registry@2.bind(35, "xdg_wm_base", 1, new id [unknown]@9) [3252759.393] wl_registry@2.global(36, "zwlr_data_control_manager_v1", 2) [3252759.400] -> wl_registry@2.bind(36, "zwlr_data_control_manager_v1", 2, new id [unknown]@10) [3252759.409] wl_registry@2.global(37, "zwp_primary_selection_device_manager_v1", 1) [3252759.417] -> wl_registry@2.bind(37, "zwp_primary_selection_device_manager_v1", 1, new id [unknown]@11) [3252759.425] wl_registry@2.global(38, "xwayland_shell_v1", 1) [3252759.432] wl_registry@2.global(39, "wl_drm", 2) [3252759.439] wl_registry@2.global(40, "zwp_linux_dmabuf_v1", 5) [3252759.446] wl_registry@2.global(41, "hyprland_toplevel_export_manager_v1", 2) [3252759.453] wl_registry@2.global(42, "zwp_text_input_manager_v1", 1) [3252759.460] wl_registry@2.global(43, "hyprland_global_shortcuts_manager_v1", 1) [3252759.467] wl_registry@2.global(44, "zwlr_screencopy_manager_v1", 3) [3252759.474] wl_registry@2.global(45, "wp_drm_lease_device_v1", 1) [3252759.482] wl_registry@2.global(46, "wl_output", 4) [3252759.489] wl_callback@3.done(12318) [3252759.497] -> wl_display@1.sync(new id wl_callback@3) [3252759.699] wl_display@1.delete_id(3) [3252759.706] wl_seat@4.name("Hyprland") [3252759.713] wl_seat@4.capabilities(3) [3252759.723] wl_callback@3.done(12318) [3252759.732] -> zwlr_data_control_manager_v1@10.get_data_device(new id zwlr_data_control_device_v1@3, wl_seat@4) [3252759.795] zwlr_data_control_device_v1@3.data_offer(new id zwlr_data_control_offer_v1@4278190080) [3252759.802] zwlr_data_control_offer_v1@4278190080.offer("text/plain") [3252759.809] zwlr_data_control_offer_v1@4278190080.offer("text/plain") [3252759.816] zwlr_data_control_offer_v1@4278190080.offer("text/plain;charset=utf-8") [3252759.823] zwlr_data_control_offer_v1@4278190080.offer("TEXT") [3252759.832] zwlr_data_control_offer_v1@4278190080.offer("STRING") [3252759.838] zwlr_data_control_offer_v1@4278190080.offer("UTF8_STRING") [3252759.845] zwlr_data_control_device_v1@3.selection(zwlr_data_control_offer_v1@4278190080) [3252759.869] -> zwlr_data_control_offer_v1@4278190080.receive("text/plain;charset=utf-8", fd 6) [3161487.609][rs] -> wl_display@1.get_registry(wl_registry@2) [3161487.656][rs] -> wl_display@1.sync(wl_callback@3) [3161487.780][rs] <- wl_registry@2.global, (1, Some("wl_seat"), 9) [3161487.840][rs] <- wl_registry@2.global, (2, Some("wl_data_device_manager"), 3) [3161487.888][rs] <- wl_registry@2.global, (3, Some("wl_compositor"), 6) [3161487.953][rs] <- wl_registry@2.global, (4, Some("wl_subcompositor"), 1) [3161488.017][rs] <- wl_registry@2.global, (5, Some("wl_shm"), 1) [3161488.096][rs] <- wl_registry@2.global, (6, Some("wp_viewporter"), 1) [3161488.166][rs] <- wl_registry@2.global, (7, Some("wp_tearing_control_manager_v1"), 1) [3161488.264][rs] <- wl_registry@2.global, (8, Some("wp_fractional_scale_manager_v1"), 1) [3161488.372][rs] <- wl_registry@2.global, (9, Some("zxdg_output_manager_v1"), 3) [3161488.445][rs] <- wl_registry@2.global, (10, Some("wp_cursor_shape_manager_v1"), 1) [3161488.545][rs] <- wl_registry@2.global, (11, Some("zwp_idle_inhibit_manager_v1"), 1) [3161488.647][rs] <- wl_registry@2.global, (12, Some("zwp_relative_pointer_manager_v1"), 1) [3161488.767][rs] <- wl_registry@2.global, (13, Some("zxdg_decoration_manager_v1"), 1) [3161488.865][rs] <- wl_registry@2.global, (14, Some("wp_alpha_modifier_v1"), 1) [3161488.963][rs] <- wl_registry@2.global, (15, Some("zwlr_gamma_control_manager_v1"), 1) [3161489.058][rs] <- wl_registry@2.global, (16, Some("ext_foreign_toplevel_list_v1"), 1) [3161489.170][rs] <- wl_registry@2.global, (17, Some("zwp_pointer_gestures_v1"), 3) [3161489.263][rs] <- wl_registry@2.global, (18, Some("zwlr_foreign_toplevel_manager_v1"), 3) [3161489.393][rs] <- wl_registry@2.global, (19, Some("zwp_keyboard_shortcuts_inhibit_manager_v1"), 1) [3161489.525][rs] <- wl_registry@2.global, (20, Some("zwp_text_input_manager_v3"), 1) [3161489.626][rs] <- wl_registry@2.global, (21, Some("zwp_pointer_constraints_v1"), 1) [3161489.738][rs] <- wl_registry@2.global, (22, Some("zwlr_output_power_manager_v1"), 1) [3161489.845][rs] <- wl_registry@2.global, (23, Some("xdg_activation_v1"), 1) [3161489.950][rs] <- wl_registry@2.global, (24, Some("ext_idle_notifier_v1"), 1) [3161490.060][rs] <- wl_registry@2.global, (25, Some("ext_session_lock_manager_v1"), 1) [3161490.188][rs] <- wl_registry@2.global, (26, Some("zwp_input_method_manager_v2"), 1) [3161490.346][rs] <- wl_registry@2.global, (27, Some("zwp_virtual_keyboard_manager_v1"), 1) [3161490.489][rs] <- wl_registry@2.global, (28, Some("zwlr_virtual_pointer_manager_v1"), 2) [3161490.624][rs] <- wl_registry@2.global, (29, Some("zwlr_output_manager_v1"), 4) [3161490.752][rs] <- wl_registry@2.global, (30, Some("org_kde_kwin_server_decoration_manager"), 1) [3161490.904][rs] <- wl_registry@2.global, (31, Some("hyprland_focus_grab_manager_v1"), 1) [3161491.031][rs] <- wl_registry@2.global, (32, Some("zwp_tablet_manager_v2"), 1) [3161491.140][rs] <- wl_registry@2.global, (33, Some("zwlr_layer_shell_v1"), 5) [3161491.239][rs] <- wl_registry@2.global, (34, Some("wp_presentation"), 1) [3161491.370][rs] <- wl_registry@2.global, (35, Some("xdg_wm_base"), 6) [3161491.443][rs] <- wl_registry@2.global, (36, Some("zwlr_data_control_manager_v1"), 2) [3161491.551][rs] <- wl_registry@2.global, (37, Some("zwp_primary_selection_device_manager_v1"), 1) [3161491.693][rs] <- wl_registry@2.global, (38, Some("xwayland_shell_v1"), 1) [3161491.807][rs] <- wl_registry@2.global, (39, Some("wl_drm"), 2) [3161491.889][rs] <- wl_registry@2.global, (40, Some("zwp_linux_dmabuf_v1"), 5) [3161491.997][rs] <- wl_registry@2.global, (41, Some("hyprland_toplevel_export_manager_v1"), 2) [3161492.141][rs] <- wl_registry@2.global, (42, Some("zwp_text_input_manager_v1"), 1) [3161492.270][rs] <- wl_registry@2.global, (43, Some("hyprland_global_shortcuts_manager_v1"), 1) [3161492.465][rs] <- wl_registry@2.global, (44, Some("zwlr_screencopy_manager_v1"), 3) [3161492.610][rs] <- wl_registry@2.global, (45, Some("wp_drm_lease_device_v1"), 1) [3161492.727][rs] <- wl_registry@2.global, (46, Some("wl_output"), 4) [3161492.804][rs] <- wl_callback@3.done, (11881) [3161492.847][rs] <- wl_display@1.delete_id, (3) [3161492.926][rs] -> wl_registry@2.bind(36, Some("zwlr_data_control_manager_v1"), 1, zwlr_data_control_manager_v1@3) [3161493.079][rs] -> wl_registry@2.bind(1, Some("wl_seat"), 2, wl_seat@4) [3161493.203][rs] -> zwlr_data_control_manager_v1@3.get_data_device(zwlr_data_control_device_v1@5, wl_seat@4) [3161493.262][rs] -> wl_display@1.sync(wl_callback@6) [3161493.569][rs] <- wl_seat@4.name, (Some("Hyprland")) [3161493.695][rs] <- wl_seat@4.capabilities, (3) [3161493.763][rs] <- zwlr_data_control_device_v1@5.data_offer, (zwlr_data_control_offer_v1@4278190080) [3161493.825][rs] <- zwlr_data_control_offer_v1@4278190080.offer, (Some("text/plain")) [3161493.924][rs] <- zwlr_data_control_offer_v1@4278190080.offer, (Some("text/plain")) [3161494.034][rs] <- zwlr_data_control_offer_v1@4278190080.offer, (Some("text/plain;charset=utf-8")) [3161494.163][rs] <- zwlr_data_control_offer_v1@4278190080.offer, (Some("TEXT")) [3161494.240][rs] <- zwlr_data_control_offer_v1@4278190080.offer, (Some("STRING")) [3161494.332][rs] <- zwlr_data_control_offer_v1@4278190080.offer, (Some("UTF8_STRING")) [3161494.438][rs] <- zwlr_data_control_device_v1@5.selection, (zwlr_data_control_offer_v1@4278190080) [3161494.495][rs] <- zwlr_data_control_device_v1@5.primary_selection, (@0) [3161494.550][rs] <- wl_callback@6.done, (11881) [3161494.595][rs] <- wl_display@1.delete_id, (6) [3161494.719][rs] -> zwlr_data_control_offer_v1@4278190080.destroy() [3161495.584][rs] -> zwlr_data_control_manager_v1@3.create_data_source(zwlr_data_control_source_v1@6) [3161495.676][rs] -> zwlr_data_control_source_v1@6.offer(Some("text/plain;charset=utf-8")) [3161495.811][rs] -> zwlr_data_control_source_v1@6.offer(Some("UTF8_STRING")) [3161495.915][rs] -> zwlr_data_control_source_v1@6.offer(Some("text/plain")) [3161496.016][rs] -> zwlr_data_control_source_v1@6.offer(Some("STRING")) [3161496.119][rs] -> zwlr_data_control_source_v1@6.offer(Some("TEXT")) [3161496.209][rs] -> zwlr_data_control_device_v1@5.set_selection(zwlr_data_control_source_v1@6) [3252765.274] -> zwlr_data_control_offer_v1@4278190080.destroy() ```
YaLTeR commented 3 weeks ago

Does it reproduce using the built-in wl-copy/wl-paste binaries? What about the same binaries from wl-clipboard (the C one, not -rs)?

0x5a4 commented 3 weeks ago

Exact same behaviour with the -rs wl-copy/wl-paste binaries. The output from wl-paste I posted is the C one btw.

One thing i forgot to mention that makes this even weirder is that when trying to paste something from wl-clipboard-rs, the clipboard gets cleared...

Im using the code samples from the readme.

YaLTeR commented 3 weeks ago

Could you test with the original C wl-copy/paste, if they reproduce the issue?

0x5a4 commented 3 weeks ago

They do

YaLTeR commented 3 weeks ago

Then it's a compositor bug

0x5a4 commented 3 weeks ago

I've also been suspecting that, hyprland has been quite unreliable since 0.40...

But when i copy something using the rust wl-copy, C wl-paste can read it just fine. This feels like a problem with the examples then?

0x5a4 commented 3 weeks ago

Could you test with the original C wl-copy/paste, if they reproduce the issue?

Did you mean just copy pasting with them in general? Because that works.

They also have the issue with not being able to read what wl-clipboard-rs copied

YaLTeR commented 3 weeks ago

I mean, if there's a problem that wl-copy copies something that then cannot be pasted in other programs, and this problem reproduces with both -rs and C wl-copy, then it's a compositor bug. If it only reproduces with the -rs wl-copy but not the C one, I'll need WAYLAND_DEBUG from both when attempting copy and (broken) paste.

0x5a4 commented 3 weeks ago

The problem doesnt occur when copying with wl-copy (both Rust and C). It does however occur when using the example from the README (or through arboard, which is how i originally found this).

Code:

use wl_clipboard_rs::copy::{MimeType, Options, Source};

fn main(){
    let opts = Options::new(); opts.copy(
        Source::Bytes("Hello world!".to_string().into_bytes().into()),
        MimeType::Autodetect,
    )
    .unwrap();
}

WL_DEBUG from this program and running C wl-paste afterwards is already included in the Issue description.

YaLTeR commented 3 weeks ago

Ah, I see. You need to keep the program running to actually serve the paste requests. This is how the clipboard works on Wayland and X11.

0x5a4 commented 3 weeks ago

Ah, thats interesting. But how does wl-copy work then? It doesnt seem to keep running after i copy something and yet i can still paste it

0x5a4 commented 3 weeks ago

Ah, just looked at the source. Thanks for helping me!