Skip to content

fix: add X11BypassWindowManagerHint to panel popup window flags - #1698

Merged
wjyrich merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-bug-373349
Aug 12, 2026
Merged

fix: add X11BypassWindowManagerHint to panel popup window flags#1698
wjyrich merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-bug-373349

Conversation

@wjyrich

@wjyrich wjyrich commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
  1. Add Qt.X11BypassWindowManagerHint flag to panel popup window on X11 platforms
  2. Fix popup window positioning issues caused by window manager interference
  3. Ensure popup window is placed correctly at the panel location
  4. Maintain consistent behavior with other X11 popup windows in the environment

Log: Fixed panel popup window positioning issue on X11 platforms

Influence:

  1. Verify panel popup window displays correctly on X11 with various window managers
  2. Test popup window positioning and alignment with the panel
  3. Confirm popup window appears above other windows
  4. Test on Wayland to ensure no regression in window behavior
  5. Verify popup window functionality across different desktop environments

fix: 为面板弹窗窗口添加X11BypassWindowManagerHint标志

  1. 在X11平台上为面板弹窗窗口添加Qt.X11BypassWindowManagerHint标志
  2. 修复窗口管理器干扰导致的弹窗定位问题
  3. 确保弹窗窗口正确显示在面板位置
  4. 保持与其他X11环境弹窗窗口行为的一致性

Log: 修复X11平台面板弹窗定位问题

Influence:

  1. 在X11平台使用不同窗口管理器验证面板弹窗显示正常
  2. 测试弹窗窗口与面板的对齐和定位
  3. 确认弹窗窗口显示在其他窗口之上
  4. 在Wayland平台测试确保窗口行为无回归
  5. 在不同桌面环境下验证弹窗窗口功能

PMS: BUG-373349

Summary by Sourcery

Adjust panel popup window flags on X11 to avoid window manager interference and ensure correct positioning at the panel.

Bug Fixes:

  • Fix incorrect panel popup positioning on X11 caused by window manager handling of the window.

Enhancements:

  • Align panel popup window behavior with other X11 popups by adding the X11BypassWindowManagerHint flag on X11 platforms.

1. Add Qt.X11BypassWindowManagerHint flag to panel popup window on X11
platforms
2. Fix popup window positioning issues caused by window manager
interference
3. Ensure popup window is placed correctly at the panel location
4. Maintain consistent behavior with other X11 popup windows in the
environment

Log: Fixed panel popup window positioning issue on X11 platforms

Influence:
1. Verify panel popup window displays correctly on X11 with various
window managers
2. Test popup window positioning and alignment with the panel
3. Confirm popup window appears above other windows
4. Test on Wayland to ensure no regression in window behavior
5. Verify popup window functionality across different desktop
environments

fix: 为面板弹窗窗口添加X11BypassWindowManagerHint标志

1. 在X11平台上为面板弹窗窗口添加Qt.X11BypassWindowManagerHint标志
2. 修复窗口管理器干扰导致的弹窗定位问题
3. 确保弹窗窗口正确显示在面板位置
4. 保持与其他X11环境弹窗窗口行为的一致性

Log: 修复X11平台面板弹窗定位问题

Influence:
1. 在X11平台使用不同窗口管理器验证面板弹窗显示正常
2. 测试弹窗窗口与面板的对齐和定位
3. 确认弹窗窗口显示在其他窗口之上
4. 在Wayland平台测试确保窗口行为无回归
5. 在不同桌面环境下验证弹窗窗口功能

PMS: BUG-373349
@sourcery-ai

sourcery-ai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds the Qt.X11BypassWindowManagerHint flag to the panel popup window on X11 (xcb) to prevent window manager interference and fix positioning/stacking behavior while keeping non-X11 behavior unchanged.

Flow diagram for setting PanelPopupWindow flags on X11 vs non-X11

flowchart LR
    A[PanelPopupWindow initialization] --> B{Qt.platform.pluginName === xcb}
    B -->|true| C[flags = Qt.Tool or Qt.WindowStaysOnTopHint or Qt.X11BypassWindowManagerHint]
    B -->|false| D[flags = Qt.Popup]
Loading

File-Level Changes

Change Details Files
Adjust window flags for the panel popup on X11 to bypass the window manager and improve positioning and stacking behavior.
  • Extend the X11-specific flags from Qt.Tool
Qt.WindowStaysOnTopHint to also include Qt.X11BypassWindowManagerHint when Qt.platform.pluginName is "xcb"
  • Keep Qt.Popup as the flag configuration for non-X11 platforms (e.g., Wayland), ensuring behavior there is unchanged

  • Tips and commands

    Interacting with Sourcery

    • Trigger a new review: Comment @sourcery-ai review on the pull request.
    • Continue discussions: Reply directly to Sourcery's review comments.
    • Generate a GitHub issue from a review comment: Ask Sourcery to create an
      issue from a review comment by replying to it. You can also reply to a
      review comment with @sourcery-ai issue to create an issue from it.
    • Generate a pull request title: Write @sourcery-ai anywhere in the pull
      request title to generate a title at any time. You can also comment
      @sourcery-ai title on the pull request to (re-)generate the title at any time.
    • Generate a pull request summary: Write @sourcery-ai summary anywhere in
      the pull request body to generate a PR summary at any time exactly where you
      want it. You can also comment @sourcery-ai summary on the pull request to
      (re-)generate the summary at any time.
    • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
      request to (re-)generate the reviewer's guide at any time.
    • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
      pull request to resolve all Sourcery comments. Useful if you've already
      addressed all the comments and don't want to see them anymore.
    • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
      request to dismiss all existing Sourcery reviews. Especially useful if you
      want to start fresh with a new review - don't forget to comment
      @sourcery-ai review to trigger a new review!

    Customizing Your Experience

    Access your dashboard to:

    • Enable or disable review features such as the Sourcery-generated pull request
      summary, the reviewer's guide, and others.
    • Change the review language.
    • Add, remove or edit custom review instructions.
    • Adjust other review settings.

    Getting Help

    @sourcery-ai sourcery-ai Bot left a comment

    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Hey - I've left some high level feedback:

    • Consider extracting the X11-specific flag logic into a helper or shared component so other X11 popup windows can reuse the same configuration and avoid duplicating the platform check.
    • Adding Qt.X11BypassWindowManagerHint may affect focus and interaction behavior; it would be helpful to explicitly verify and, if needed, constrain this flag to only the scenarios where window manager interference is known to cause positioning issues.
    Prompt for AI Agents
    Please address the comments from this code review:
    
    ## Overall Comments
    - Consider extracting the X11-specific flag logic into a helper or shared component so other X11 popup windows can reuse the same configuration and avoid duplicating the platform check.
    - Adding Qt.X11BypassWindowManagerHint may affect focus and interaction behavior; it would be helpful to explicitly verify and, if needed, constrain this flag to only the scenarios where window manager interference is known to cause positioning issues.

    Sourcery is free for open source - if you like our reviews please consider sharing them ✨
    Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

    @deepin-ci-robot

    Copy link
    Copy Markdown

    deepin pr auto review

    ★ 总体评分:100分

    ■ 【总体评价】

    代码正确修复了XCB环境下弹窗受窗口管理器干扰的显示异常问题
    语法无误且符合组件设计意图,无任何扣分项

    ■ 【详细分析】

    • 1.语法逻辑(完全正确)✓

    代码在 PanelPopupWindow.qmlflags 属性中,通过三元运算符正确判断平台,并使用位或操作符 | 准确组合了 Qt.ToolQt.WindowStaysOnTopHint 和新增的 Qt.X11BypassWindowManagerHint 标志,QML语法完全正确
    建议:保持当前写法即可

    • 2.代码质量(良好)✓

    针对X11平台特有的窗口管理器干预问题,精准添加了对应的绕过标志,逻辑清晰且符合QML与DTK的开发规范,没有引入冗余代码
    建议:保持当前写法即可

    • 3.代码性能(无性能问题)✓

    此修改仅为静态属性赋值,在窗口初始化时执行一次,不涉及任何运行时计算、循环或系统调用,无性能损耗
    建议:保持当前写法即可

    • 4.代码安全(存在0个安全漏洞)✓

    漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
    尽管添加了 Qt.X11BypassWindowManagerHint 会使得窗口绕过窗口管理器的安全约束(如焦点控制与合成器保护),但该窗口属于 dde-dock 面板的内部弹出组件,由受信任的桌面进程创建并在用户主动交互时显示,不存在被恶意利用的攻击面,无安全风险

    • 建议:无需额外安全修复

    ■ 【改进建议代码示例】

    --- a/frame/qml/PanelPopupWindow.qml
    +++ b/frame/qml/PanelPopupWindow.qml
    @@ -74,7 +74,7 @@ PopupWindow {
     
         width: 10
         height: 10
    -    flags: (Qt.platform.pluginName === "xcb" ?  (Qt.Tool | Qt.WindowStaysOnTopHint) : Qt.Popup)
    +    flags: (Qt.platform.pluginName === "xcb" ?  (Qt.Tool | Qt.WindowStaysOnTopHint | Qt.X11BypassWindowManagerHint) : Qt.Popup)
         font: D.DTK.fontManager.t6
         D.DWindow.enabled: true
         D.DWindow.windowRadius: D.DTK.platformTheme.windowRadius < 0 ? 4 : D.DTK.platformTheme.windowRadius

    @deepin-ci-robot

    Copy link
    Copy Markdown

    [APPROVALNOTIFIER] This PR is NOT APPROVED

    This pull-request has been approved by: mhduiy, wjyrich

    The full list of commands accepted by this bot can be found here.

    Details Needs approval from an approver in each of these files:

    Approvers can indicate their approval by writing /approve in a comment
    Approvers can cancel approval by writing /approve cancel in a comment

    @wjyrich
    wjyrich merged commit 0193b25 into linuxdeepin:master Aug 12, 2026
    12 of 13 checks passed
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    None yet

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    3 participants