From 62d06bcdc0879aae576fdd8f654306092b9c3d29 Mon Sep 17 00:00:00 2001 From: Ethan Burns Date: Mon, 10 Nov 2025 17:59:31 -0500 Subject: [PATCH] Offer mime type UTF8_STRING for snarf. For whatever reason when offering only text/plain, the snarf can't paste into Firefox. Offering also UTF8_STRING seems to fix it. --- src/cmd/devdraw/wayland.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cmd/devdraw/wayland.c b/src/cmd/devdraw/wayland.c index 96630b8c..8b06c5e0 100644 --- a/src/cmd/devdraw/wayland.c +++ b/src/cmd/devdraw/wayland.c @@ -300,8 +300,9 @@ void wl_data_source_send(void *data, const char *mime_type, int32_t fd) { DEBUG("wl_data_source_send(mime_type=%s)\n", mime_type); - if (strcmp(mime_type, "text/plain") != 0) { - DEBUG("unknown mime type\n"); + if (strcmp(mime_type, "text/plain") != 0 && + strcmp(mime_type, "UTF8_STRING") != 0) { + DEBUG("unknown mime type: %s\n", mime_type); close(fd); return; } @@ -1143,6 +1144,7 @@ void rpc_putsnarf(char *snarf_in) { wl_data_device_manager_create_data_source(wl_data_device_manager); wl_data_source_add_listener(source, &wl_data_source_listener, NULL); wl_data_source_offer(source, "text/plain"); + wl_data_source_offer(source, "UTF8_STRING"); wl_data_device_set_selection(wl_data_device, source, keyboard_enter_serial); qunlock(&wayland_lock);