Repository navigation
fix: restore LIBDJK_SUPPORT guard for window input type - #839
Draft
pppanghu77 wants to merge 1 commit into
Draft
pppanghu77 wants to merge 1 commit into
pppanghu77 wants to merge 1 commit into
Conversation
1. Root cause: commit 0617b0f 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 4544639 and the develop/v25 branch (commit 5b45e34) 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 0617b0f 移除了 #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 4544639 的回归前行为及 develop/v25 分支 (commit 5b45e34)一致 3. 影响:仅影响 Wayland 会话,窗口类型从 InputOutput 恢复为 InputOnly; X11 会话不受影响(InputOnly 与 InputOutput 在 X11 选区所有权行为一致) Influence: 1. 测试 Wayland 会话下建立协同后的剪贴板同步 2. 验证 X11 会话下剪贴板同步(回归验证,行为不变) 3. 验证建立协同后鼠标共享和文件传输功能正常 PMS: BUG-341993
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pppanghu77 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
pppanghu77
marked this pull request as draft
October 29, 2026 19:28
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis low-risk fix restores the LIBDJK_SUPPORT compilation guard in XWindowsScreen::openWindow(), causing builds without LibDJK support to create InputOnly windows and restoring clipboard synchronization on Wayland while preserving existing X11 behavior. Sequence diagram for Wayland clipboard synchronizationsequenceDiagram
participant Sender
participant XWindowsScreen
participant XWindowsClipboard
participant XWayland
participant Receiver
Sender->>XWindowsScreen: openWindow()
XWindowsScreen->>XWindowsScreen: XCreateWindow(inputType = InputOnly)
Sender->>XWindowsClipboard: copy text
XWindowsClipboard->>XWayland: XSetSelectionOwner(InputOnly window)
XWayland-->>Receiver: clipboard selection
Flow diagram for guarded window input type selectionflowchart TD
A["openWindow()"] --> B{LIBDJK_SUPPORT defined?}
B -->|Yes| C["WaylandUtils.isWayland()"]
C -->|Wayland| D[InputOutput]
C -->|X11| E[InputOnly]
B -->|No| E
D --> F[XCreateWindow]
E --> F
F --> G[Clipboard synchronization]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root Cause Analysis
Commit
0617b0f7("feat: Remove displayjack kvm depend") removed the#ifdef LIBDJK_SUPPORTconditional compilation guard inXWindowsScreen::openWindow(), makinginputTypeunconditionallyWaylandUtils::isWayland() ? InputOutput : InputOnly. On Wayland sessions, this creates anInputOutputwindow that gets unmapped viaXUnmapWindowinenter();XWindowsClipboardthen callsXSetSelectionOwneron this unmappedInputOutputwindow, but XWayland does not bridge that selection to the native Wayland clipboard — so the receiver's clipboard never displays the copied text.Fix
Restore the
#ifdef LIBDJK_SUPPORTguard so that whenLIBDJK_SUPPORTis undefined (which it always is — nofind_package(LibDJK)call exists in the project),inputTypefalls back toInputOnly. This matches the pre-regression behavior from commit45446393and thedevelop/v25branch (commit5b45e349).Change Safety Assessment
Code Safety
inputType) inopenWindow()— no function signature changes, no public member changes, zero external callers (reference list empty)0617b0f7, not a historical fix product; this change does not revert any existing fixBusiness Impact Scope
Affected module: Cross-device cooperation — clipboard sync. After establishing cooperation, the sender copies text and the receiver's clipboard should display it. On Wayland sessions, the window type changes from
InputOutput(broken) back toInputOnly(correct). X11 sessions are unaffected —InputOnlyandInputOutputbehave identically for clipboard selection ownership on plain X11.Verification Suggestion
Test clipboard sync after establishing cooperation on Wayland. Verify X11 clipboard sync as regression (behavior unchanged). Verify mouse sharing and file transfer still work.
根因分析
commit
0617b0f7("feat: Remove displayjack kvm depend")移除了XWindowsScreen::openWindow()中的#ifdef LIBDJK_SUPPORT条件编译守卫,使inputType无条件使用WaylandUtils::isWayland() ? InputOutput : InputOnly。Wayland 会话下创建InputOutput窗口,在enter()中被XUnmapWindow取消映射;XWindowsClipboard在该未映射InputOutput窗口上调用XSetSelectionOwner,但 XWayland 不将该选区桥接到原生 Wayland 剪贴板,导致接收端剪贴板不显示复制的文本。修复方案
恢复
#ifdef LIBDJK_SUPPORT守卫,使LIBDJK_SUPPORT未定义时(项目中无find_package(LibDJK)调用,永远未定义)inputType回退为InputOnly,与 commit45446393的回归前行为及develop/v25分支(commit5b45e349)一致。改动安全评估
代码安全评估
openWindow()内为局部变量inputType恢复条件编译守卫,不修改函数签名、不增删公开成员、无外部调用者(引用列表为空)0617b0f7引入的回归,非历史修复产物,本次改动不撤销任何已有修复业务影响范围
受影响模块:跨端协同 — 剪贴板同步。建立协同后,发送端复制文本,接收端剪贴板应正确显示。Wayland 会话下窗口类型从
InputOutput(回归)恢复为InputOnly(正确)。X11 会话不受影响——InputOnly与InputOutput在 X11 选区所有权行为一致。验证建议
测试 Wayland 会话下建立协同后的剪贴板同步。验证 X11 会话剪贴板同步(回归验证,行为不变)。验证鼠标共享和文件传输功能正常。
Summary by Sourcery
Bug Fixes: