fix: correct window flags to prevent KWin animation on screen indicator#3257
fix: correct window flags to prevent KWin animation on screen indicator#3257tsic404 wants to merge 1 commit into
Conversation
The previous window flags included Qt.FramelessWindowHint and Qt.SplashScreen, which caused KWin to apply unnecessary window animations to the screen indicator windows. Changed to use Qt.Tool instead, which is more appropriate for transient helper windows and prevents KWin from adding animations. Log: Fixed incorrect window type causing unwanted KWin animations Influence: 1. Verify screen indicator displays correctly without animation effects 2. Test screen indicator visibility on multi-monitor setups 3. Confirm window stays on top as expected 4. Verify screen indicator closes properly when timer elapses fix: 修复窗口类型错误导致kwin给屏幕指示器窗口添加动画 之前的窗口标志包含了Qt.FramelessWindowHint和Qt.SplashScreen,导致KWin为 屏幕指示器窗口应用了不必要的动画。改为使用Qt.Tool,这个类型更适合临时辅 助窗口,可以防止KWin添加动画效果。 Log: 修复错误的窗口类型导致KWin动画问题 Influence: 1. 验证屏幕指示器正常显示且无动画效果 2. 测试多显示器设置下的屏幕指示器可见性 3. 确认窗口保持置顶功能正常 4. 验证屏幕指示器在计时结束后正常关闭 PMS: BUG-360795
deepin pr auto review你好!我是CodeGeeX。我已仔细审查了你提供的Git Diff输入。本次修改主要针对一个QML界面指示器( 以下是我从语法逻辑、代码质量、代码性能和代码安全四个维度提出的详细审查意见和改进建议: 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
💡 综合改进建议代码结合上述分析,我为你提供一份优化后的代码示例(假设仍需保留多窗口结构,并修复了无边框和代码冗余问题): // SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick 2.15
import org.deepin.dcc 1.0
Window {
id: root
// 提取公共标志位,便于维护。加回了 FramelessWindowHint 保证无边框
property int indicatorFlags: Qt.WindowStaysOnTopHint | Qt.Tool | Qt.FramelessWindowHint | Qt.X11BypassWindowManagerHint
// 提取魔法数字,增强可读性
property int borderIndicatorWidth: 10
flags: indicatorFlags
color: "#2ca7f8"
x: screen.virtualX
y: screen.virtualY
width: screen.width
height: screen.height
Timer {
interval: 2000
running: true
onTriggered: root.close()
}
// 顶部指示器
Window {
flags: root.indicatorFlags
visible: root.visible
color: root.color
screen: root.screen
x: screen.virtualX
y: screen.virtualY
width: screen.width
height: root.borderIndicatorWidth
}
// 底部指示器
Window {
flags: root.indicatorFlags
visible: root.visible
color: root.color
screen: root.screen
x: screen.virtualX
y: screen.virtualY + screen.height - root.borderIndicatorWidth
width: screen.width
height: root.borderIndicatorWidth
}
// 左侧指示器
Window {
flags: root.indicatorFlags
visible: root.visible
color: root.color
screen: root.screen
x: screen.virtualX
y: screen.virtualY
width: root.borderIndicatorWidth
height: screen.height
}
// 右侧指示器
Window {
flags: root.indicatorFlags
visible: root.visible
color: root.color
screen: root.screen
x: screen.virtualX + screen.width - root.borderIndicatorWidth
y: screen.virtualY
width: root.borderIndicatorWidth
height: screen.height
}
}主要改动点说明:
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tsic404 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 |
|
TAG Bot New tag: 6.1.90 |
|
TAG Bot New tag: 6.1.91 |
|
TAG Bot New tag: 6.1.92 |
|
TAG Bot New tag: 6.1.93 |
|
TAG Bot New tag: 6.1.94 |
|
TAG Bot New tag: 6.1.95 |
|
TAG Bot New tag: 6.1.96 |
|
TAG Bot New tag: 6.1.97 |
The previous window flags included Qt.FramelessWindowHint and Qt.SplashScreen, which caused KWin to apply unnecessary window animations to the screen indicator windows. Changed to use Qt.Tool instead, which is more appropriate for transient helper windows and prevents KWin from adding animations.
Log: Fixed incorrect window type causing unwanted KWin animations
Influence:
fix: 修复窗口类型错误导致kwin给屏幕指示器窗口添加动画
之前的窗口标志包含了Qt.FramelessWindowHint和Qt.SplashScreen,导致KWin为 屏幕指示器窗口应用了不必要的动画。改为使用Qt.Tool,这个类型更适合临时辅
助窗口,可以防止KWin添加动画效果。
Log: 修复错误的窗口类型导致KWin动画问题
Influence:
PMS: BUG-360795