Repository navigation
fix: restore LIBDJK_SUPPORT guard for clipboard - #782
Johnson-zs wants to merge 1 commit into
Conversation
1. Root cause: commit 6c1ee78 removed the #ifdef LIBDJK_SUPPORT guard in XWindowsScreen::openWindow(), making m_window an InputOutput window on Wayland; after enter() unmaps it, XSetSelectionOwner on an unmapped InputOutput 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, matching the pre-regression behavior and the develop/v25 fix 3. Impact: Wayland sessions revert to InputOnly window for clipboard selection ownership; non-Wayland behavior unchanged Log: fix clipboard content not showing on receiver after screen switch Influence: 1. Test clipboard sharing in Wayland session after screen switch 2. Verify clipboard sharing regression in X11 session 3. Test repeated screen switches for clipboard reliability fix: 恢复 LIBDJK_SUPPORT 守卫修复协同剪贴板 1. 根因:commit 6c1ee78 移除了 XWindowsScreen::openWindow() 中的 #ifdef LIBDJK_SUPPORT 守卫,导致 Wayland 下 m_window 创建为 InputOutput 类型;enter() unmap 该窗口后,XSetSelectionOwner 在 unmapped 的 InputOutput 窗口上设置的选区无法被 XWayland 桥接到原生 Wayland 剪贴板 2. 方案:恢复 #ifdef LIBDJK_SUPPORT 守卫,未定义时 inputType 回退 为 InputOnly,与回归前行为及 develop/v25 修复一致 3. 影响:Wayland 会话恢复使用 InputOnly 窗口持有剪贴板选区所有权, 非 Wayland 环境行为不变 Log: 修复协同后接收端剪贴板内容不显示的问题 Influence: 1. 测试 Wayland 会话下屏幕切换后剪贴板共享 2. 验证 X11 会话下剪贴板共享功能无回归 3. 测试多次反复切换屏幕的剪贴板可靠性 PMS: BUG-341993
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Johnson-zs 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 |
There was a problem hiding this comment.
Sorry @Johnson-zs, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRestores the LIBDJK_SUPPORT conditional guard around the X11 window input type selection so that, in non-LIBDJK builds (including current baseline), the Barrier X11 window used for clipboard and input on Wayland is created as InputOnly instead of InputOutput, matching pre-regression behavior and fixing clipboard sharing on Wayland/XWayland during screen switches. Sequence diagram for Wayland clipboard sharing during screen switchsequenceDiagram
participant Screen as XWindowsScreen
participant XServer as X11/XWayland
participant Clipboard as XWindowsClipboard
participant Wayland as NativeWaylandClipboard
Screen->>XServer: XCreateWindow(inputType=InputOnly)
Screen->>XServer: XUnmapWindow(m_window)
Clipboard->>XServer: XSetSelectionOwner(m_window)
XServer->>Wayland: Bridge clipboard selection
Wayland-->>Clipboard: Clipboard content available
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Root Cause Analysis
In
XWindowsScreen::openWindow()(XWindowsScreen.cpp:1040), commit6c1ee78bremoved the#ifdef LIBDJK_SUPPORTconditional guard, causingm_windowto be created asInputOutputon Wayland sessions. This window serves double duty: input grabbing and clipboard selection ownership (XWindowsClipboardreuses it at:161,XSetSelectionOwneratXWindowsClipboard.cpp:285). During screen switch,enter()callsXUnmapWindow(:279), thensetClipboardrunsXSetSelectionOwneron the now-unmappedInputOutputwindow. XWayland does not bridge selections on unmappedInputOutputwindows to the native Wayland clipboard, so the receiver's clipboard stays empty.Fix
Restored the
#ifdef LIBDJK_SUPPORTguard inopenWindow(). WhenLIBDJK_SUPPORTis undefined (confirmed not defined in the baseline CMake),inputTypefalls back toInputOnly, matching pre-regression behavior and the develop/v25 branch fix.Change Safety Assessment
Code Safety
openWindow()(both withinXWindowsScreenclass), both unaffected by the change0617b0f7which removed the guard; this fix restores only the guard, not the full commit, preserving the displayjack dependency removalBusiness Impact Scope
Affects clipboard sharing during screen switch in Wayland sessions only. Non-Wayland (X11) sessions are unchanged (already
InputOnly). The fix restoresInputOnlywindow type so clipboard selection ownership remains valid afterXUnmapWindow, allowing XWayland to bridge the selection to the native Wayland clipboard.Verification Suggestion
根因分析
XWindowsScreen::openWindow()(XWindowsScreen.cpp:1040)中,commit6c1ee78b移除了#ifdef LIBDJK_SUPPORT条件编译守卫,导致 Wayland 会话下m_window被创建为InputOutput类型。该窗口同时承担输入抓取和剪贴板选区所有权双重职责(XWindowsClipboard在:161复用该窗口,XWindowsClipboard.cpp:285执行XSetSelectionOwner)。屏幕切换时enter()先XUnmapWindow(:279),紧接着setClipboard在已 unmapped 的InputOutput窗口上执行XSetSelectionOwner,XWayland 不桥接该选区到原生 Wayland 剪贴板,导致接收端剪贴板为空。修复方案
恢复
openWindow()中的#ifdef LIBDJK_SUPPORT守卫。当前基线未定义LIBDJK_SUPPORT,inputType回退为InputOnly,与回归前行为及 develop/v25 分支修复一致。改动安全评估
代码安全评估
openWindow()仅有 2 处内部引用(均在XWindowsScreen类内),均不受影响0617b0f7移除守卫引入,本次仅恢复守卫部分,不影响移除 displayjack 依赖的初衷业务影响范围
仅影响 Wayland 会话下屏幕切换时的协同剪贴板共享。非 Wayland(X11)会话行为不变(原本即为
InputOnly)。恢复InputOnly窗口类型后,XUnmapWindow后剪贴板选区所有权仍有效,XWayland 可正常桥接到原生 Wayland 剪贴板。验证建议
PMS: BUG-341993
Summary by Sourcery
Bug Fixes: