From 98733bb654b40d9cd8f8c8cf16cee5c6a779ed61 Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Thu, 9 Apr 2026 19:47:38 +0200 Subject: [PATCH] Reserve screen space for the dock in convergence mode Add an invisible layer-shell surface with an exclusive zone matching the dock height. KWin uses this to shrink MaximizeArea so maximized and tiled windows no longer overlap the dock. The previous approach of tweaking the nav-panel PanelView was a dead end: PanelView resets its own surface properties on reconfiguration and Wayland offers no way to set struts from a KWin script. A separate surface at LayerBottom with exclusionZone is the intended protocol mechanism. --- containments/taskpanel/qml/main.qml | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/containments/taskpanel/qml/main.qml b/containments/taskpanel/qml/main.qml index 8720bd88..6b84f23e 100644 --- a/containments/taskpanel/qml/main.qml +++ b/containments/taskpanel/qml/main.qml @@ -86,9 +86,6 @@ ContainmentItem { root.panel.offset = intendedWindowOffset; root.panel.thickness = navigationPanelHeight; root.panel.location = intendedWindowLocation; - // In convergence mode the navigation panel is invisible (its functions - // live in the dock), so auto-hide the panel window to avoid reserving - // empty screen space at the bottom edge. root.panel.visibilityMode = (ShellSettings.Settings.autoHidePanelsEnabled || ShellSettings.Settings.convergenceModeEnabled) ? 3 : 0; MobileShell.ShellUtil.setWindowLayer(root.panel, LayerShell.Window.LayerOverlay); root.updateTouchArea(); @@ -135,10 +132,35 @@ ContainmentItem { function onAutoHidePanelsEnabledChanged() { root.setWindowProperties(); } + + function onConvergenceModeEnabledChanged() { + root.setWindowProperties(); + } } Component.onCompleted: setWindowProperties(); + // Invisible layer-shell surface that reserves screen space for the dock + // in convergence mode. Sits at LayerBottom (below windows, above the + // desktop) with an exclusive zone equal to the dock height so that KWin + // shrinks MaximizeArea accordingly. Input-transparent so clicks fall + // through to the homescreen dock underneath. + Window { + id: dockSpaceReserver + visible: ShellSettings.Settings.convergenceModeEnabled + color: "transparent" + flags: Qt.FramelessWindowHint | Qt.WindowTransparentForInput + // height is set by layer-shell anchoring; provide a fallback. + height: Kirigami.Units.gridUnit * 3 + width: 1 // layer-shell stretches it via AnchorLeft|AnchorRight + + LayerShell.Window.scope: "dock-space" + LayerShell.Window.layer: LayerShell.Window.LayerBottom + LayerShell.Window.anchors: LayerShell.Window.AnchorBottom | LayerShell.Window.AnchorLeft | LayerShell.Window.AnchorRight + LayerShell.Window.exclusionZone: Kirigami.Units.gridUnit * 3 + LayerShell.Window.keyboardInteractivity: LayerShell.Window.KeyboardInteractivityNone + } + // only opaque if there are no maximized windows on this screen readonly property bool showingStartupFeedback: MobileShellState.ShellDBusObject.startupFeedbackModel.activeWindowIsStartupFeedback && startupFeedbackColorAnimation.visible && windowMaximizedTracker.windowCount === 1 readonly property bool opaqueBar: {