Skip to content

Commit ce3ad8f

Browse files
committed
fix: Let notification center use Wayland exclusive zones
The Wayland notification center panel should rely on compositor-reserved exclusive zones rather than adding Dock margins itself. - Add a layer-shell margin helper that returns zero on Wayland and preserves windowMargin() elsewhere. - Set exclusionZone to 0 on Wayland and keep -1 for non-Wayland platforms. - Avoid extra Dock spacing on Wayland without changing X11 behavior. Wayland 通知中心面板应依赖合成器预留的独占区域,而不是自身继续叠加 Dock 边距。 - 增加 layer-shell 边距辅助函数,在 Wayland 下返回 0,其他平台继续使用 windowMargin()。 - Wayland 下将 exclusionZone 设置为 0,非 Wayland 平台保持 -1。 - 避免 Wayland 下出现额外 Dock 间距,同时不改变 X11 行为。 Log: Let notification center use Wayland exclusive zones Pms: BUG-365785
1 parent f68c4f6 commit ce3ad8f

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

  • panels/notification/center/package

panels/notification/center/package/main.qml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ Window {
8181
}
8282
}
8383

84+
function layerShellMargin(position) {
85+
if (Qt.platform.pluginName === "wayland")
86+
return 0
87+
88+
return windowMargin(position)
89+
}
90+
8491
// visible: true
8592
visible: Panel.visible
8693
flags: Qt.Tool
@@ -90,10 +97,10 @@ Window {
9097
// height: 800
9198
DLayerShellWindow.layer: DLayerShellWindow.LayerOverlay
9299
DLayerShellWindow.anchors: DLayerShellWindow.AnchorRight | DLayerShellWindow.AnchorTop | DLayerShellWindow.AnchorBottom
93-
DLayerShellWindow.topMargin: windowMargin(0) + contentPadding
94-
DLayerShellWindow.rightMargin: windowMargin(1) + contentPadding
95-
DLayerShellWindow.bottomMargin: windowMargin(2) + contentPadding
96-
DLayerShellWindow.exclusionZone: -1
100+
DLayerShellWindow.topMargin: layerShellMargin(0) + contentPadding
101+
DLayerShellWindow.rightMargin: layerShellMargin(1) + contentPadding
102+
DLayerShellWindow.bottomMargin: layerShellMargin(2) + contentPadding
103+
DLayerShellWindow.exclusionZone: Qt.platform.pluginName === "wayland" ? 0 : -1
97104
DLayerShellWindow.keyboardInteractivity: DLayerShellWindow.KeyboardInteractivityOnDemand
98105
palette: DTK.palette
99106
ColorSelector.family: Palette.CrystalColor

0 commit comments

Comments
 (0)