fix: use layer-shell for screen indicator on wayland#3288
Conversation
150519b to
efa918b
Compare
|
TAG Bot New tag: 6.1.92 |
|
TAG Bot New tag: 6.1.93 |
fe78894 to
8ff31d5
Compare
| // 顶部边框:锚定顶部,左右拉伸 | ||
| DS.DLayerShellWindow.anchors: DS.DLayerShellWindow.AnchorTop | DS.DLayerShellWindow.AnchorLeft | DS.DLayerShellWindow.AnchorRight | ||
| DS.DLayerShellWindow.layer: DS.DLayerShellWindow.LayerOverlay | ||
| DS.DLayerShellWindow.exclusionZone: -1 |
22658f6 to
4db7c2d
Compare
1. Replace absolute x/y positioning with DLayerShellWindow anchors in ScreenIndicator.qml (both display and personalization) 2. Use AnchorTop/Bottom/Left/Right for border indicator windows instead of virtualX/virtualY coordinates 3. Migrate ScreenRecognize.qml to use AnchorBottom with margin for centered-bottom positioning 4. Remove isX11 guard in DisplayMain.qml so indicators work on Wayland/Treeland 5. Add DDEShell dependency in CMakeLists.txt PMS: BUG-351883 Log: Fix screen indicator and recognition dialog not working on Treeland Wayland environment Influence: 1. Connect external monitor, open Display settings, click Identify - border indicators should correctly highlight each screen edge 2. On Treeland, drag to change screen arrangement and click Identify - indicator borders should appear on the correct monitor fix: 使用 layer-shell 实现屏幕指示器在 Wayland 下的正确定位 1. 将 ScreenIndicator.qml 中的绝对 x/y 坐标定位替换为 DLayerShellWindow 锚定方式(display 和 personalization 模块) 2. 使用 AnchorTop/Bottom/Left/Right 锚定边框指示窗口, 替代 virtualX/virtualY 坐标 3. 将 ScreenRecognize.qml 迁移到使用 AnchorBottom + margin 实现底部居中定位 4. 移除 DisplayMain.qml 中的 isX11 条件判断, 使指示器在 Wayland 下也能正常显示 5. 在 CMakeLists.txt 中添加 DDEShell 依赖 PMS: BUG-351883 Log: 修复 Treeland Wayland 环境下屏幕指示器和识别弹框不生效的问题 Influence: 1. 接入外接显示器,打开控制中心显示设置,点击识别 - 边框指示器应正确高亮各屏幕边缘 2. 在 Treeland 环境下,拖动切换屏幕拼接位置后点击识别 - 指示器边框应出现在正确的显示器上
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // ScreenRecognize.qml:优化底部边距计算,避免初始化时因 height 为 0 导致的位置跳动
Window {
id: root
property string name: "screen"
property real realBottomMargin: 400
signal escPressed
flags: Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint
D.DWindow.enabled: true
color: D.DTK.palette.window
DS.DLayerShellWindow.anchors: DS.DLayerShellWindow.AnchorBottom
DS.DLayerShellWindow.layer: DS.DLayerShellWindow.LayerOverlay
// 使用 Binding 延迟绑定,确保在窗口真实尺寸计算完成后再更新 margin
Binding {
target: root
property: "realBottomMargin"
value: (root.screen && root.screen.height > 0 && root.height > 0)
? Math.max(0, root.screen.height * 0.25 - root.height * 0.5)
: 400
}
DS.DLayerShellWindow.bottomMargin: root.realBottomMargin
width: control.implicitWidth
height: control.implicitHeight
visible: root.height > 0 // 确保布局完成后再显示,消除视觉闪烁
onClosing: destroy(10)
Text {
id: control
leftPadding: 22
topPadding: 12
rightPadding: leftPadding
bottomPadding: topPadding
text: root.name
font: D.DTK.fontManager.t4
color: D.DTK.palette.brightText
}
Shortcut {
sequence: "Esc"
onActivated: root.escPressed()
}
} |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, caixr23 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 |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
PMS: BUG-351883
Log: Fix screen indicator and recognition dialog not working on Treeland Wayland environment
Influence:
fix: 使用 layer-shell 实现屏幕指示器在 Wayland 下的正确定位
PMS: BUG-351883
Log: 修复 Treeland Wayland 环境下屏幕指示器和识别弹框不生效的问题
Influence: