Skip to content

fix(ui): fix settings dialog always-on-top and reduce clipboard log n…#363

Merged
pengfeixx merged 1 commit into
linuxdeepin:develop/snipefrom
pengfeixx:fix/settings-dialog-window-level
Jun 12, 2026
Merged

fix(ui): fix settings dialog always-on-top and reduce clipboard log n…#363
pengfeixx merged 1 commit into
linuxdeepin:develop/snipefrom
pengfeixx:fix/settings-dialog-window-level

Conversation

@pengfeixx

@pengfeixx pengfeixx commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

…oise

Remove WindowStaysOnTopHint from settings dialog and add WindowModal modality so it stays above main window but not above other apps.

移除设置窗口的置顶标志,改用WindowModal模态使其仅在主窗口之上。

Log: 修复设置窗口置顶问题并降低剪贴板日志级别
PMS: BUG-364661
Influence: 设置窗口不再全局置顶,仅在语音记事本主窗口之上;剪贴板相关日志从Info降为Debug减少日志噪音。

Summary by Sourcery

Adjust settings dialog window behavior and reduce clipboard logging verbosity.

Bug Fixes:

  • Ensure the settings dialog only stays above the main window instead of always staying on top of all applications.

Enhancements:

  • Change clipboard-related logging from info to debug level to reduce log noise.

@pengfeixx pengfeixx force-pushed the fix/settings-dialog-window-level branch from 49943be to 9913764 Compare June 12, 2026 07:28
@sourcery-ai

sourcery-ai Bot commented Jun 12, 2026

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

Reviewer's Guide

Adjusts settings dialog window behavior to be modal only over the main window instead of globally always-on-top, and lowers clipboard-related logging from info to debug to reduce log noise.

File-Level Changes

Change Details Files
Lower clipboard change logs from info to debug to reduce log verbosity.
  • Changed clipboard change start log from qInfo to qDebug.
  • Changed clipboard change completion log from qInfo to qDebug.
src/common/jscontent.cpp
Change settings dialog window flags to remove global always-on-top and make it window-modal over the main window.
  • Replaced WindowStaysOnTopHint with a basic Window flag while keeping the close button hint.
  • Introduced WindowModal modality so the settings dialog stays above the main window but not above other applications.
src/gui/dialog/SettingDialog.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.

@pengfeixx pengfeixx force-pushed the fix/settings-dialog-window-level branch 2 times, most recently from d34755c to d7c8074 Compare June 12, 2026 07:31
…oise

Remove WindowStaysOnTopHint from settings dialog and add WindowModal
modality so it stays above main window but not above other apps.

移除设置窗口的置顶标志,改用WindowModal模态使其仅在主窗口之上。

Log: 修复设置窗口置顶问题并降低剪贴板日志级别
PMS: BUG-364661
Influence: 设置窗口不再全局置顶,仅在语音记事本主窗口之上;剪贴板相关日志从Info降为Debug减少日志噪音。
@pengfeixx pengfeixx force-pushed the fix/settings-dialog-window-level branch from d7c8074 to cc3613e Compare June 12, 2026 08:32
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lzwind, pengfeixx

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

@pengfeixx pengfeixx merged commit be2e20f into linuxdeepin:develop/snipe Jun 12, 2026
20 of 22 checks passed
@pengfeixx pengfeixx deleted the fix/settings-dialog-window-level branch June 12, 2026 08:40
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

<style> .ai-report h1 { color: #2c3e50; border-bottom: 2px solid #2c3e50; padding-bottom: 10px; font-size: 24px; } .ai-report h2 { color: #2980b9; margin-top: 25px; font-size: 20px; } .ai-report h3 { color: #34495e; font-size: 16px; } .ai-report .solution-box { background-color: #f8f9fa; padding: 15px; border-left: 4px solid #28a745; margin-top: 10px; } .ai-report .info-needed { background-color: #fff3cd; padding: 15px; border-left: 4px solid #ffc107; margin-top: 10px; } .ai-report .note { background-color: #e7f4ff; padding: 15px; border-left: 4px solid #17a2b8; margin-top: 10px; } .ai-report code { background-color: #f1f2f3; padding: 2px 4px; border-radius: 3px; color: #d63384; font-family: monospace; } </style>

问题分析报告

问题分析

本次提交主要修复了deepin-voice-note项目中的两个核心问题:1. 日志刷屏问题:在src/common/jscontent.cpp文件的JsContent::onClipChange函数中,使用了qInfo级别打印剪贴板状态变化。由于剪贴板变化事件触发极为频繁,导致产生大量冗余日志,严重干扰正常问题的排查。2. 窗口层级/模态异常问题:在src/gui/dialog/SettingDialog.qml中,设置对话框错误地使用了Qt.WindowStaysOnTopHint标志,且未正确设置模态属性,导致窗口层级管理异常。

解决方案

  1. 降级剪贴板日志级别:修改src/common/jscontent.cpp文件,将onClipChange函数内的两处qInfo调用替换为qDebug,从而在默认日志级别下过滤掉高频的剪贴板变化日志,避免日志刷屏。
  2. 修正设置对话框窗口属性:修改src/gui/dialog/SettingDialog.qml文件,移除Qt.WindowStaysOnTopHint标志并补充Qt.Window标志,同时显式添加modality: Qt.WindowModal属性,确保设置对话框具有正确的窗口模态行为和层级关系。

补充说明

在编写涉及高频事件(如剪贴板监听、鼠标移动等)的回调函数时,应严格避免使用qInfoqWarning进行过程状态打印,统一使用qDebug以便在生产环境中按需关闭。对于QML对话框组件,应优先使用modality属性来控制模态状态,避免滥用Qt.WindowStaysOnTopHint破坏窗口管理器的正常Z轴层级排序。

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