Skip to content

fix: make X11 bypass window manager hint configurable - #1705

Closed
wjyrich wants to merge 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-bug-394541
Closed

fix: make X11 bypass window manager hint configurable#1705
wjyrich wants to merge 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-bug-394541

Conversation

@wjyrich

@wjyrich wjyrich commented Aug 20, 2026

Copy link
Copy Markdown
Contributor
  1. Add useX11BypassWindowManagerHint property to PanelPopupWindow with default value of true
  2. Expose the same property on PanelPopup for per-instance override
  3. Add a Binding to propagate the property from PanelPopup to the internal popup window
  4. Conditionally apply Qt.X11BypassWindowManagerHint in window flags only when enabled
  5. This allows individual popup instances to disable the hint for WM compatibility

Log: Popup windows can now optionally disable the X11 bypass window manager hint for compatibility with certain window managers

Influence:

  1. Test panel popup windows on X11 with default settings to verify no regression
  2. Test popup behavior with useX11BypassWindowManagerHint set to false to ensure window manager decorations and management work correctly
  3. Verify popup positioning, focus behavior, and stacking with both values of the property
  4. Test on Wayland to confirm no impact on existing behavior
  5. Test popups across different panel plugins to ensure compatibility

fix: 使 X11 绕过窗口管理器提示可配置

  1. PanelPopupWindow 中添加 useX11BypassWindowManagerHint 属性,默 认值为 true
  2. PanelPopup 上暴露相同属性,支持按实例覆盖
  3. 添加 Binding 将该属性从 PanelPopup 传播到内部弹出窗口
  4. 仅当属性启用时,才在窗口标志中有条件地应用 Qt.X11BypassWindowManagerHint
  5. 这允许单个弹出窗口实例禁用该提示以兼容特定窗口管理器

Log: 弹出窗口现在可以可选地禁用 X11 绕过窗口管理器提示,以便兼容某些窗口
管理器

Influence:

  1. 在 X11 上使用默认设置测试面板弹出窗口,验证无回归
  2. useX11BypassWindowManagerHint 设置为 false 测试弹出行为,确保 窗口管理器装饰和管理正常工作
  3. 验证两种属性值下的弹出窗口定位、焦点行为和层叠顺序
  4. 在 Wayland 上测试,确认对现有行为无影响
  5. 测试不同面板插件的弹出窗口以确保兼容性

PMS: TASK-394541

Summary by Sourcery

Make the X11 bypass window-manager hint configurable for panel popup instances.

New Features:

  • Add configurable X11 window-manager hint behavior to panel popups, with per-instance control over whether the bypass hint is used.

Enhancements:

  • Preserve the existing default behavior while allowing popups to disable the X11 bypass hint for window-manager compatibility.

1. Add `useX11BypassWindowManagerHint` property to `PanelPopupWindow`
with default value of `true`
2. Expose the same property on `PanelPopup` for per-instance override
3. Add a Binding to propagate the property from `PanelPopup` to the
internal popup window
4. Conditionally apply `Qt.X11BypassWindowManagerHint` in window flags
only when enabled
5. This allows individual popup instances to disable the hint for WM
compatibility

Log: Popup windows can now optionally disable the X11 bypass window
manager hint for compatibility with certain window managers

Influence:
1. Test panel popup windows on X11 with default settings to verify no
regression
2. Test popup behavior with `useX11BypassWindowManagerHint` set to
`false` to ensure window manager decorations and management work
correctly
3. Verify popup positioning, focus behavior, and stacking with both
values of the property
4. Test on Wayland to confirm no impact on existing behavior
5. Test popups across different panel plugins to ensure compatibility

fix: 使 X11 绕过窗口管理器提示可配置

1. 在 `PanelPopupWindow` 中添加 `useX11BypassWindowManagerHint` 属性,默
认值为 `true`
2. 在 `PanelPopup` 上暴露相同属性,支持按实例覆盖
3. 添加 Binding 将该属性从 `PanelPopup` 传播到内部弹出窗口
4. 仅当属性启用时,才在窗口标志中有条件地应用
`Qt.X11BypassWindowManagerHint`
5. 这允许单个弹出窗口实例禁用该提示以兼容特定窗口管理器

Log: 弹出窗口现在可以可选地禁用 X11 绕过窗口管理器提示,以便兼容某些窗口
管理器

Influence:
1. 在 X11 上使用默认设置测试面板弹出窗口,验证无回归
2. 将 `useX11BypassWindowManagerHint` 设置为 `false` 测试弹出行为,确保
窗口管理器装饰和管理正常工作
3. 验证两种属性值下的弹出窗口定位、焦点行为和层叠顺序
4. 在 Wayland 上测试,确认对现有行为无影响
5. 测试不同面板插件的弹出窗口以确保兼容性

PMS: TASK-394541
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 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

@sourcery-ai

sourcery-ai Bot commented Aug 20, 2026

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

Reviewer's Guide

Make the X11 bypass window manager hint configurable per popup by adding a new property to PanelPopupWindow and PanelPopup, binding it between them, and conditionally applying the X11 hint in window flags based on that property.

Sequence diagram for per-popup X11 bypass hint configuration

sequenceDiagram
    participant PanelPopup
    participant Binding
    participant PanelPopupWindow

    PanelPopup->>PanelPopup: useX11BypassWindowManagerHint = false
    PanelPopup->>Binding: readyBinding = true
    Binding->>PanelPopupWindow: useX11BypassWindowManagerHint = PanelPopup.useX11BypassWindowManagerHint

    alt [Qt.platform.pluginName === xcb]
        alt [useX11BypassWindowManagerHint true]
            PanelPopupWindow->>PanelPopupWindow: flags = Qt.Tool | Qt.WindowStaysOnTopHint | Qt.X11BypassWindowManagerHint
        else [useX11BypassWindowManagerHint false]
            PanelPopupWindow->>PanelPopupWindow: flags = Qt.Tool | Qt.WindowStaysOnTopHint
        end
    else [Qt.platform.pluginName !== xcb]
        PanelPopupWindow->>PanelPopupWindow: flags = Qt.Popup
    end
Loading

File-Level Changes

Change Details Files
Introduce a configurable flag to control use of the X11 bypass window manager hint for panel popups and wire it through the popup window.
  • Add useX11BypassWindowManagerHint property with default true to PanelPopupWindow for per-window configuration.
  • Update the flags expression in PanelPopupWindow to include Qt.X11BypassWindowManagerHint only when useX11BypassWindowManagerHint is true on X11 (xcb) and otherwise omit it.
  • Add useX11BypassWindowManagerHint property to PanelPopup to allow per-instance override by panel plugins or callers.
  • Add a Binding in PanelPopup that propagates control.useX11BypassWindowManagerHint to popupWindow.useX11BypassWindowManagerHint once the window is ready.
frame/qml/PanelPopupWindow.qml
frame/qml/PanelPopup.qml

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

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:100分

■ 【总体评价】

代码将硬编码的窗口标志位改为可配置属性,有效提升了不同窗口管理器的兼容性
逻辑清晰,保持了向后兼容性,且未引入任何安全漏洞

■ 【详细分析】

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

代码在 PanelPopup.qml 中新增了 useX11BypassWindowManagerHint 属性,并通过 Binding 绑定到 popupWindow。在 PanelPopupWindow.qml 中使用三元运算符根据该属性决定是否应用 Qt.X11BypassWindowManagerHint 标志位。默认值为 true 保证了原有行为不变。
潜在问题:无
建议:无

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

属性命名与原有风格一致,清晰表达了意图。在 PanelPopupWindow.qml 中添加了注释说明该属性的作用,提高了代码可读性。Bindingwhen 条件复用了 readyBinding,符合 QML 生命周期管理。
潜在问题:无
建议:无

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

仅增加了一个布尔属性和一个属性绑定,开销极小,不会对渲染或窗口创建性能产生可察觉的影响。
潜在问题:无
建议:无

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

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次代码修改仅涉及 QML 窗口标志位的条件判断,不涉及敏感数据操作、外部输入处理或系统命令调用,不存在安全风险。

  • 建议:无需针对安全进行额外修复

■ 【改进建议代码示例】

// 当前代码已经很好地实现了功能且无安全问题,无需修改。
// 以下展示如何在具体使用场景中覆盖该属性以禁用 BypassWindowManagerHint:

// 在某个特定的弹窗实例中(例如需要窗口管理器管理其焦点和位置的弹窗):
PanelPopup {
    useX11BypassWindowManagerHint: false // 覆盖默认值,允许窗口管理器接管
    // ... 其他属性配置
}

@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:

  • In PanelPopupWindow.flags, consider using Qt.WindowFlags(0) instead of bare 0 for the disabled hint branch to make the type and intent clearer and avoid relying on implicit enum coercion.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `PanelPopupWindow.flags`, consider using `Qt.WindowFlags(0)` instead of bare `0` for the disabled hint branch to make the type and intent clearer and avoid relying on implicit enum coercion.

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.

@wjyrich wjyrich closed this Aug 21, 2026
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.

2 participants