From ba815b89432e6668b5a3da9e5e751c4f2a7fcb63 Mon Sep 17 00:00:00 2001 From: liujinchang Date: Thu, 29 Oct 2026 01:52:05 +0800 Subject: [PATCH] fix: restore LIBDJK_SUPPORT guard for clipboard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Root cause: commit 0617b0f7 removed the #ifdef LIBDJK_SUPPORT guard in openWindow(), making WaylandUtils::isWayland() ? InputOutput : InputOnly execute unconditionally; in Wayland sessions the InputOutput window gets unmapped by enter(), and XSetSelectionOwner on the unmapped window is not bridged by XWayland to the native Wayland clipboard 2. Fix: restore the #ifdef LIBDJK_SUPPORT guard so that when LIBDJK_SUPPORT is undefined inputType falls back to InputOnly, preventing the window from being unmapped and allowing XSetSelectionOwner to work correctly 3. Impact: only affects Wayland session window creation type; X11 sessions are unaffected (WaylandUtils::isWayland() returns false) Log: fix clipboard sharing not working in Wayland sessions Influence: 1. Test cross-device clipboard sharing in Wayland session 2. Verify X11 session cross-device cooperation has no regression fix: 恢复 LIBDJK_SUPPORT 守卫修复剪贴板共享 1. 根因:commit 0617b0f7 移除了 openWindow() 中的 #ifdef LIBDJK_SUPPORT 守卫,导致 WaylandUtils::isWayland() ? InputOutput : InputOnly 无条件执行;Wayland 会话下 InputOutput 窗口被 enter() 取消映射,XSetSelectionOwner 在 unmapped 窗口上设置的选区不被 XWayland 桥接到原生 Wayland 剪贴板 2. 方案:恢复 #ifdef LIBDJK_SUPPORT 守卫,未定义时 inputType 回退为 InputOnly,窗口不被 enter() unmap, XSetSelectionOwner 正常工作 3. 影响:仅影响 Wayland 会话下窗口创建类型;X11 会话不受影响 Log: 修复 Wayland 会话下剪贴板共享不生效的问题 Influence: 1. 测试 Wayland 会话下跨端剪贴板共享功能 2. 验证 X11 会话下跨端协同功能无回归 PMS: BUG-278649 --- 3rdparty/barrier/src/lib/platform/XWindowsScreen.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/3rdparty/barrier/src/lib/platform/XWindowsScreen.cpp b/3rdparty/barrier/src/lib/platform/XWindowsScreen.cpp index 5041ffd26..5c548c489 100644 --- a/3rdparty/barrier/src/lib/platform/XWindowsScreen.cpp +++ b/3rdparty/barrier/src/lib/platform/XWindowsScreen.cpp @@ -1037,7 +1037,11 @@ XWindowsScreen::openWindow() const } // create and return the window +#ifdef LIBDJK_SUPPORT unsigned inputType = WaylandUtils::isWayland() ? InputOutput : InputOnly; +#else + unsigned inputType = InputOnly; +#endif Window window = m_impl->XCreateWindow(m_display, m_root, x, y, w, h, 0, 0, inputType, CopyFromParent, CWDontPropagate | CWEventMask |