From 1e918414d1a978e188cf89e11c803da86933eb94 Mon Sep 17 00:00:00 2001 From: mx Date: Thu, 26 Nov 2026 14:35:28 +0100 Subject: [PATCH] Present an empty frame before a notch drop unmaps A fast close jumps from a visible bead straight to 0 in one tick, and hiding in that tick left the bead as the layer's last frame, which Hyprland then faded out. Keep the drawer mapped for a few frames after closing so an empty frame is drawn first. Co-Authored-By: Claude Opus 5.5 --- quickshell/components/BarDrawer.qml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/quickshell/components/BarDrawer.qml b/quickshell/components/BarDrawer.qml index b45c97f..5f4b29a 100644 --- a/quickshell/components/BarDrawer.qml +++ b/quickshell/components/BarDrawer.qml @@ -35,10 +35,23 @@ Item { readonly property real revealed: unrolls ? Math.max(0, contentHeight * progress) : contentHeight // Drop moves down on the way in and on the way out. property real dropFrom: -1 - onOpenChanged: dropFrom = open ? -1 : 1 - // The drop is already empty below 0.02; unmapping there means Hyprland's - // fade-out has nothing left to fade. - readonly property bool shown: progress > (liquid ? 0.02 : 0.001) + // Hyprland fades out a layer's last frame when it unmaps. A fast close can + // jump from a visible bead straight to 0, so the drop stays mapped for a + // few frames after closing to present an empty frame first. + readonly property bool shown: progress > 0.001 || holdEmpty + property bool holdEmpty: false + onOpenChanged: { + dropFrom = open ? -1 : 1; + holdEmpty = !open && liquid && progress > 0.001; + emptyFrames.stop(); + } + onProgressChanged: if (holdEmpty && progress <= 0.001) + emptyFrames.restart() + Timer { + id: emptyFrames + interval: 60 + onTriggered: root.holdEmpty = false + } // NotchDrop's content fade: in once the panel has its size, out first. readonly property real dropContent: { const t = Math.min(1, Math.max(0, (progress - 0.82) / 0.18));