From cea9aeb803c02a86775fc642249827445b48941e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 12 Aug 2026 20:28:49 +0530 Subject: [PATCH] Wayland: Fix clipboard sharing between kitty instances in containers with isolated PID namespaces Dont rely on PID alone for the self transfer sentinel. Fixes #10352 --- docs/changelog.rst | 2 ++ glfw/wl_window.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 98f8fca8e..17d671d10 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -205,6 +205,8 @@ Detailed list of changes - Sessions: Also save/restore layouts other than the currently active layout (:pull:`10324`) +- Wayland: Fix clipboard sharing between kitty instances in containers with isolated PID namespaces (:iss:`10352`) + 0.48.2 [2026-07-30] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/glfw/wl_window.c b/glfw/wl_window.c index 30d161978..cc1074ba7 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -440,8 +440,8 @@ _glfwWaylandAfterBufferSwap(_GLFWwindow *window) { static const char * clipboard_mime(void) { - static char buf[128] = {0}; - if (buf[0] == 0) { snprintf(buf, sizeof(buf), "application/glfw+clipboard-%d", getpid()); } + static char buf[256] = {0}; + if (buf[0] == 0) { snprintf(buf, sizeof(buf), "application/glfw+clipboard-%d-%lld", getpid(), (long long)monotonic_start_time); } return buf; }