Skip to content

fix: improve overlay window behavior on X11 and add background styling#3321

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
52cyb:260629
Jun 29, 2026
Merged

fix: improve overlay window behavior on X11 and add background styling#3321
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
52cyb:260629

Conversation

@52cyb

@52cyb 52cyb commented Jun 29, 2026

Copy link
Copy Markdown
Contributor
  1. Add Qt.X11BypassWindowManagerHint flag to ScreenIndicator to ensure window bypasses window manager on X11
  2. Replace D.DWindow.enabled with Qt.Tool flag in ScreenRecognize for proper window manager integration
  3. Add Rectangle background with rounded corners to ScreenRecognize for proper visual appearance
  4. Remove DLayerShellWindow exclusion zone dependency for more reliable overlay behavior

Log: Fixed overlay window display issues on X11

Influence:

  1. Test ScreenIndicator overlay display on X11 environments
  2. Verify ScreenRecognize window shows with correct rounded corners
  3. Test window positioning with DLayerShellWindow anchors
  4. Verify ESC key press handling still works
  5. Test on both Wayland and X11 to ensure no regressions
  6. Verify tool window behavior in multi-monitor setups

fix: 优化X11环境下的覆盖窗口行为并添加背景样式

  1. 为 ScreenIndicator 添加 Qt.X11BypassWindowManagerHint 标志,确保窗口 在 X11 下绕过窗口管理器
  2. 将 ScreenRecognize 中的 D.DWindow.enabled 替换为 Qt.Tool 标志,实现更 合适的窗口管理器集成
  3. 为 ScreenRecognize 添加带圆角的矩形背景,确保正确的视觉效果
  4. 移除对 DLayerShellWindow 排除区域的依赖,实现更可靠的覆盖层行为

Log: 修复了X11下覆盖窗口显示问题

Influence:

  1. 在X11环境下测试ScreenIndicator覆盖层显示效果
  2. 验证ScreenRecognize窗口显示正确的圆角背景
  3. 测试使用DLayerShellWindow锚点定位窗口功能
  4. 验证ESC按键处理功能仍正常工作
  5. 在Wayland和X11下测试,确保无回归问题
  6. 验证多显示器设置中工具窗口的行为

PMS: BUG-367935

Summary by Sourcery

Improve overlay window behavior and appearance for screen-related tool windows on X11 and Wayland.

New Features:

  • Add a rounded-corner background rectangle to the ScreenRecognize window for improved visual styling.

Bug Fixes:

  • Adjust ScreenIndicator and ScreenRecognize window flags to fix overlay display and window manager integration issues on X11.

Enhancements:

  • Make ScreenRecognize a tool-type window and rely less on DLayerShellWindow exclusion zones to improve overlay reliability across environments.

1. Add Qt.X11BypassWindowManagerHint flag to ScreenIndicator to ensure
window bypasses window manager on X11
2. Replace D.DWindow.enabled with Qt.Tool flag in ScreenRecognize for
proper window manager integration
3. Add Rectangle background with rounded corners to ScreenRecognize for
proper visual appearance
4. Remove DLayerShellWindow exclusion zone dependency for more reliable
overlay behavior

Log: Fixed overlay window display issues on X11

Influence:
1. Test ScreenIndicator overlay display on X11 environments
2. Verify ScreenRecognize window shows with correct rounded corners
3. Test window positioning with DLayerShellWindow anchors
4. Verify ESC key press handling still works
5. Test on both Wayland and X11 to ensure no regressions
6. Verify tool window behavior in multi-monitor setups

fix: 优化X11环境下的覆盖窗口行为并添加背景样式

1. 为 ScreenIndicator 添加 Qt.X11BypassWindowManagerHint 标志,确保窗口
在 X11 下绕过窗口管理器
2. 将 ScreenRecognize 中的 D.DWindow.enabled 替换为 Qt.Tool 标志,实现更
合适的窗口管理器集成
3. 为 ScreenRecognize 添加带圆角的矩形背景,确保正确的视觉效果
4. 移除对 DLayerShellWindow 排除区域的依赖,实现更可靠的覆盖层行为

Log: 修复了X11下覆盖窗口显示问题

Influence:
1. 在X11环境下测试ScreenIndicator覆盖层显示效果
2. 验证ScreenRecognize窗口显示正确的圆角背景
3. 测试使用DLayerShellWindow锚点定位窗口功能
4. 验证ESC按键处理功能仍正常工作
5. 在Wayland和X11下测试,确保无回归问题
6. 验证多显示器设置中工具窗口的行为

PMS: BUG-367935
@sourcery-ai

sourcery-ai Bot commented Jun 29, 2026

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

Reviewer's Guide

This PR adjusts window flags and shell integration for the screen overlay windows on X11/Wayland and adds a rounded-rectangle background to the recognition window to fix overlay behavior and improve appearance.

File-Level Changes

Change Details Files
Update ScreenRecognize window flags and remove D.DWindow dependency for better WM/tool-window behavior.
  • Replace D.DWindow.enabled usage by relying solely on Qt.Window flags.
  • Add Qt.Tool to the ScreenRecognize Window flags to mark it as a tool-type window.
  • Keep always-on-top and frameless hints while changing how the window is integrated with the window manager.
src/plugin-display/qml/ScreenRecognize.qml
Add a styled background rectangle to the ScreenRecognize window so text is displayed on a proper rounded-corner surface.
  • Introduce a Rectangle filling the Window as a visual background layer.
  • Use platformTheme.windowRadius(8) to get consistent rounded corner radius.
  • Set background color to the standard palette window color instead of the Window.color property.
src/plugin-display/qml/ScreenRecognize.qml
Adjust ScreenIndicator window flags to bypass the X11 window manager while keeping overlay behavior.
  • Add Qt.X11BypassWindowManagerHint to ScreenIndicator flags.
  • Retain always-on-top and frameless hints while changing X11 integration.
  • Leave DLayerShellWindow overlay layer configuration intact, with exclusionZone still set to -1.
src/plugin-display/qml/ScreenIndicator.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

@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 reviewed your changes and they look great!


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.

@52cyb

52cyb commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot deepin-bot Bot merged commit f7c53c4 into linuxdeepin:master Jun 29, 2026
15 checks passed
@deepin-ci-robot

Copy link
Copy Markdown

Hi @52cyb. Thanks for your PR.

I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants