From 3728ef7602ebfa71709281fa02efa265f510c6b1 Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Sat, 11 Apr 2026 12:05:15 +0200 Subject: [PATCH] Auto-hide dock when a window is maximized Slide the dock off-screen when WindowMaximizedTracker reports a maximized window, and bring it back on mouse proximity via a HoverHandler. The dockSpaceReserver exclusion zone drops to 0 so KWin gives the full screen to the maximized window. Animation follows the StatusBarWrapper pattern: offset property, Translate transform, Behavior with InExpo/OutExpo easing. --- containments/homescreens/folio/qml/main.qml | 28 +++++++++++++++++++++ containments/taskpanel/qml/main.qml | 4 ++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/containments/homescreens/folio/qml/main.qml b/containments/homescreens/folio/qml/main.qml index 2b5aebb3..18d9064d 100644 --- a/containments/homescreens/folio/qml/main.qml +++ b/containments/homescreens/folio/qml/main.qml @@ -176,11 +176,38 @@ ContainmentItem { LayerShell.Window.exclusionZone: -1 LayerShell.Window.keyboardInteractivity: LayerShell.Window.KeyboardInteractivityOnDemand + // Auto-hide: slide dock content off-screen when a window is + // maximized. A HoverHandler brings it back on mouse proximity. + property real dockOffset: 0 + readonly property real dockHeight: Kirigami.Units.gridUnit * 3 + readonly property bool dockHovered: dockHoverHandler.hovered + readonly property bool shouldHide: windowMaximizedTracker.showingWindow && !dockHovered + + onShouldHideChanged: { + if (shouldHide) { + dockOffset = dockHeight + } else { + dockOffset = 0 + } + } + + HoverHandler { + id: dockHoverHandler + } + + Behavior on dockOffset { + NumberAnimation { + easing.type: dockOverlay.shouldHide ? Easing.InExpo : Easing.OutExpo + duration: Kirigami.Units.longDuration + } + } + Rectangle { anchors.fill: parent Kirigami.Theme.inherit: false Kirigami.Theme.colorSet: Kirigami.Theme.Window color: Kirigami.Theme.backgroundColor + transform: Translate { y: dockOverlay.dockOffset } } FavouritesBar { @@ -189,6 +216,7 @@ ContainmentItem { folio: root.folio maskManager: root.maskManager homeScreen: folioHomeScreen + transform: Translate { y: dockOverlay.dockOffset } } } diff --git a/containments/taskpanel/qml/main.qml b/containments/taskpanel/qml/main.qml index 6b84f23e..dfe9bc94 100644 --- a/containments/taskpanel/qml/main.qml +++ b/containments/taskpanel/qml/main.qml @@ -145,6 +145,8 @@ ContainmentItem { // 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. + // When a window is maximized the exclusive zone drops to 0 so the + // window reclaims the full screen while the dock auto-hides. Window { id: dockSpaceReserver visible: ShellSettings.Settings.convergenceModeEnabled @@ -157,7 +159,7 @@ ContainmentItem { 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.exclusionZone: windowMaximizedTracker.showingWindow ? 0 : Kirigami.Units.gridUnit * 3 LayerShell.Window.keyboardInteractivity: LayerShell.Window.KeyboardInteractivityNone }