From 9251ff61b5626bbd2ec2d78607f1f43aea61b8c4 Mon Sep 17 00:00:00 2001 From: liujinchang Date: Fri, 30 Oct 2026 03:24:10 +0800 Subject: [PATCH] fix: restore LIBDJK_SUPPORT guard for window input type 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, making inputType unconditionally use WaylandUtils::isWayland() ? InputOutput : InputOnly; on Wayland sessions this creates an InputOutput window which gets unmapped in enter() via XUnmapWindow, and XWindowsClipboard's XSetSelectionOwner on the unmapped InputOutput window is not bridged by XWayland to the native Wayland clipboard, causing the receiver's clipboard to not display 2. Fix: restore the #ifdef LIBDJK_SUPPORT conditional compilation guard so that when LIBDJK_SUPPORT is undefined (which it always is, as no find_package(LibDJK) call exists), inputType falls back to InputOnly, matching the pre-regression behavior from commit 45446393 and the develop/v25 branch (commit 5b45e349) 3. Impact: only affects Wayland sessions where the window type changes from InputOutput back to InputOnly; X11 sessions are unaffected as InputOnly and InputOutput behave identically for clipboard selection ownership on plain X11 Influence: 1. Test clipboard sync after establishing cooperation on Wayland 2. Verify clipboard sync on X11 session (regression, no behavior change) 3. Verify mouse sharing and file transfer still work after cooperation fix: 恢复窗口输入类型的 LIBDJK_SUPPORT 条件编译守卫 1. 根因:commit 0617b0f7 移除了 #ifdef LIBDJK_SUPPORT 守卫,使 inputType 无条件使用 WaylandUtils::isWayland() ? InputOutput : InputOnly;Wayland 会话下创建 InputOutput 窗口,在 enter() 中被 XUnmapWindow 取消映射,XWindowsClipboard 在该未映射 InputOutput 窗口 上 XSetSelectionOwner 的选区不被 XWayland 桥接到原生 Wayland 剪贴板, 导致接收端剪贴板不显示 2. 方案:恢复 #ifdef LIBDJK_SUPPORT 条件编译守卫,LIBDJK_SUPPORT 未定义时 (项目中无 find_package(LibDJK) 调用,永远未定义)inputType 回退为 InputOnly,与 commit 45446393 的回归前行为及 develop/v25 分支 (commit 5b45e349)一致 3. 影响:仅影响 Wayland 会话,窗口类型从 InputOutput 恢复为 InputOnly; X11 会话不受影响(InputOnly 与 InputOutput 在 X11 选区所有权行为一致) Influence: 1. 测试 Wayland 会话下建立协同后的剪贴板同步 2. 验证 X11 会话下剪贴板同步(回归验证,行为不变) 3. 验证建立协同后鼠标共享和文件传输功能正常 PMS: BUG-341993 --- 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 |