From ce3ad8fd5e1e0b0529d630cddfab52824c986c19 Mon Sep 17 00:00:00 2001 From: zhaoyingzhen Date: Thu, 11 Jun 2026 15:28:39 +0800 Subject: [PATCH] fix: Let notification center use Wayland exclusive zones MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- panels/notification/center/package/main.qml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/panels/notification/center/package/main.qml b/panels/notification/center/package/main.qml index 386749766..a0d263628 100644 --- a/panels/notification/center/package/main.qml +++ b/panels/notification/center/package/main.qml @@ -81,6 +81,13 @@ Window { } } + function layerShellMargin(position) { + if (Qt.platform.pluginName === "wayland") + return 0 + + return windowMargin(position) + } + // visible: true visible: Panel.visible flags: Qt.Tool @@ -90,10 +97,10 @@ Window { // height: 800 DLayerShellWindow.layer: DLayerShellWindow.LayerOverlay DLayerShellWindow.anchors: DLayerShellWindow.AnchorRight | DLayerShellWindow.AnchorTop | DLayerShellWindow.AnchorBottom - DLayerShellWindow.topMargin: windowMargin(0) + contentPadding - DLayerShellWindow.rightMargin: windowMargin(1) + contentPadding - DLayerShellWindow.bottomMargin: windowMargin(2) + contentPadding - DLayerShellWindow.exclusionZone: -1 + DLayerShellWindow.topMargin: layerShellMargin(0) + contentPadding + DLayerShellWindow.rightMargin: layerShellMargin(1) + contentPadding + DLayerShellWindow.bottomMargin: layerShellMargin(2) + contentPadding + DLayerShellWindow.exclusionZone: Qt.platform.pluginName === "wayland" ? 0 : -1 DLayerShellWindow.keyboardInteractivity: DLayerShellWindow.KeyboardInteractivityOnDemand palette: DTK.palette ColorSelector.family: Palette.CrystalColor