From e5ec88a12b93be9268f1a5636cc161f9d17b47c6 Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Wed, 6 May 2026 13:33:38 +0200 Subject: [PATCH] Improve auto-hide dock reveal Expand the dock input region as soon as the reveal animation starts rather than waiting for it to finish, so the cursor can reach dock items while the panel is still sliding into view. Introduce updateInputRegion() and call it from onDockOffsetChanged, onShouldHideChanged, onActiveChanged, onWidthChanged, and onHeightChanged so the input region is always consistent with the current state. While hover-revealing with a maximised window present, switch the LayerShell exclusion zone from -1 to dockHeight so the window tiles away from the dock instead of being obscured underneath it. Reduce the hover dwell timer from a hard-coded 300 ms to Kirigami.Units.shortDuration so the dock is easier to summon. --- containments/homescreens/folio/qml/main.qml | 36 +++++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/containments/homescreens/folio/qml/main.qml b/containments/homescreens/folio/qml/main.qml index 3d4637fb..0dda77b1 100644 --- a/containments/homescreens/folio/qml/main.qml +++ b/containments/homescreens/folio/qml/main.qml @@ -287,7 +287,7 @@ ContainmentItem { LayerShell.Window.scope: "dock-overlay" LayerShell.Window.layer: LayerShell.Window.LayerTop LayerShell.Window.anchors: LayerShell.Window.AnchorBottom | LayerShell.Window.AnchorLeft | LayerShell.Window.AnchorRight - LayerShell.Window.exclusionZone: -1 + LayerShell.Window.exclusionZone: shouldReserveSpace ? dockHeight : -1 LayerShell.Window.keyboardInteractivity: LayerShell.Window.KeyboardInteractivityOnDemand // Auto-hide: slide dock content off-screen when a window is @@ -304,6 +304,25 @@ ContainmentItem { readonly property bool shouldHide: ShellSettings.Settings.autoHidePanelsEnabled && windowMaximizedTracker.showingWindow && !hoverRevealing + readonly property bool shouldReserveSpace: ShellSettings.Settings.autoHidePanelsEnabled + && windowMaximizedTracker.showingWindow && hoverRevealing + + function updateInputRegion() { + if (shouldHide && dockOffset >= dockHeight) { + MobileShell.ShellUtil.setInputRegion(dockOverlay, + Qt.rect(0, dockOverlay.height - revealStripHeight, + dockOverlay.width, revealStripHeight)) + } else { + MobileShell.ShellUtil.setInputRegion(dockOverlay, Qt.rect(0, 0, 0, 0)) + } + } + + onActiveChanged: { + hoverRevealTimer.stop() + hoverRevealing = false + dockOffset = shouldHide ? dockHeight : 0 + updateInputRegion() + } onShouldHideChanged: { if (shouldHide) { @@ -311,26 +330,23 @@ ContainmentItem { } else { dockOffset = 0 } + updateInputRegion() } // Narrow the input region to a strip at the screen edge when hidden // so that app controls near the bottom edge are not accidentally // intercepted. Mirrors the same pattern used by NavigationPanel. onDockOffsetChanged: { - if (dockOffset >= dockHeight) { - MobileShell.ShellUtil.setInputRegion(dockOverlay, - Qt.rect(0, dockOverlay.height - revealStripHeight, - dockOverlay.width, revealStripHeight)) - } else if (dockOffset === 0) { - MobileShell.ShellUtil.setInputRegion(dockOverlay, Qt.rect(0, 0, 0, 0)) - } + updateInputRegion() } + onWidthChanged: updateInputRegion() + onHeightChanged: updateInputRegion() - // Delay reveal by 300 ms so a quick edge graze does not pop the + // Delay reveal briefly so a quick edge graze does not pop the // dock up mid-interaction with the underlying application. Timer { id: hoverRevealTimer - interval: 300 + interval: Kirigami.Units.shortDuration repeat: false onTriggered: dockOverlay.hoverRevealing = true }